Mercurial > vim
comparison src/xdiff/xpatience.c @ 14738:ef9f4be0bc5b v8.1.0381
patch 8.1.0381: variable declaration not at start of block
commit https://github.com/vim/vim/commit/5c6f574bd1e07d6eab077fa8f28b2c0cd480b068
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 13 17:32:07 2018 +0200
patch 8.1.0381: variable declaration not at start of block
Problem: Variable declaration not at start of block.
Solution: Fix line ordering.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 13 Sep 2018 17:45:05 +0200 |
parents | 2b3ea3d42344 |
children | 3be01cf0a632 |
comparison
equal
deleted
inserted
replaced
14737:a87b88a11db7 | 14738:ef9f4be0bc5b |
---|---|
207 static struct entry *find_longest_common_sequence(struct hashmap *map) | 207 static struct entry *find_longest_common_sequence(struct hashmap *map) |
208 { | 208 { |
209 struct entry **sequence = (struct entry **)xdl_malloc(map->nr * sizeof(struct entry *)); | 209 struct entry **sequence = (struct entry **)xdl_malloc(map->nr * sizeof(struct entry *)); |
210 int longest = 0, i; | 210 int longest = 0, i; |
211 struct entry *entry; | 211 struct entry *entry; |
212 | |
213 /* Added to silence Coverity. */ | |
214 if (sequence == NULL) | |
215 return map->first; | |
216 | |
217 /* | 212 /* |
218 * If not -1, this entry in sequence must never be overridden. | 213 * If not -1, this entry in sequence must never be overridden. |
219 * Therefore, overriding entries before this has no effect, so | 214 * Therefore, overriding entries before this has no effect, so |
220 * do not do that either. | 215 * do not do that either. |
221 */ | 216 */ |
222 int anchor_i = -1; | 217 int anchor_i = -1; |
218 | |
219 /* Added to silence Coverity. */ | |
220 if (sequence == NULL) | |
221 return map->first; | |
223 | 222 |
224 for (entry = map->first; entry; entry = entry->next) { | 223 for (entry = map->first; entry; entry = entry->next) { |
225 if (!entry->line2 || entry->line2 == NON_UNIQUE) | 224 if (!entry->line2 || entry->line2 == NON_UNIQUE) |
226 continue; | 225 continue; |
227 i = binary_search(sequence, longest, entry); | 226 i = binary_search(sequence, longest, entry); |