summaryrefslogtreecommitdiff
path: root/src/xdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-09-13 17:32:07 +0200
committerBram Moolenaar <Bram@vim.org>2018-09-13 17:32:07 +0200
commit5c6f574bd1e07d6eab077fa8f28b2c0cd480b068 (patch)
tree1ed88650b6b1aeed06e71814968f306635ec3185 /src/xdiff
parent32d19c1820305729c0d1b21536b18bae2d8378ed (diff)
downloadvim-git-5c6f574bd1e07d6eab077fa8f28b2c0cd480b068.tar.gz
patch 8.1.0381: variable declaration not at start of blockv8.1.0381
Problem: Variable declaration not at start of block. Solution: Fix line ordering.
Diffstat (limited to 'src/xdiff')
-rw-r--r--src/xdiff/xpatience.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/xdiff/xpatience.c b/src/xdiff/xpatience.c
index 00af0ff11..2c65aac38 100644
--- a/src/xdiff/xpatience.c
+++ b/src/xdiff/xpatience.c
@@ -209,11 +209,6 @@ static struct entry *find_longest_common_sequence(struct hashmap *map)
struct entry **sequence = (struct entry **)xdl_malloc(map->nr * sizeof(struct entry *));
int longest = 0, i;
struct entry *entry;
-
- /* Added to silence Coverity. */
- if (sequence == NULL)
- return map->first;
-
/*
* If not -1, this entry in sequence must never be overridden.
* Therefore, overriding entries before this has no effect, so
@@ -221,6 +216,10 @@ static struct entry *find_longest_common_sequence(struct hashmap *map)
*/
int anchor_i = -1;
+ /* Added to silence Coverity. */
+ if (sequence == NULL)
+ return map->first;
+
for (entry = map->first; entry; entry = entry->next) {
if (!entry->line2 || entry->line2 == NON_UNIQUE)
continue;