diff options
Diffstat (limited to 'xdiff/xpatience.c')
| -rw-r--r-- | xdiff/xpatience.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/xdiff/xpatience.c b/xdiff/xpatience.c index 77dc411d19..669b653580 100644 --- a/xdiff/xpatience.c +++ b/xdiff/xpatience.c @@ -88,9 +88,9 @@ static int is_anchor(xpparam_t const *xpp, const char *line) static void insert_record(xpparam_t const *xpp, int line, struct hashmap *map, int pass) { - xrecord_t **records = pass == 1 ? + xrecord_t *records = pass == 1 ? map->env->xdf1.recs : map->env->xdf2.recs; - xrecord_t *record = records[line - 1]; + xrecord_t *record = &records[line - 1]; /* * After xdl_prepare_env() (or more precisely, due to * xdl_classify_record()), the "ha" member of the records (AKA lines) @@ -121,7 +121,7 @@ static void insert_record(xpparam_t const *xpp, int line, struct hashmap *map, return; map->entries[index].line1 = line; map->entries[index].hash = record->ha; - map->entries[index].anchor = is_anchor(xpp, map->env->xdf1.recs[line - 1]->ptr); + map->entries[index].anchor = is_anchor(xpp, map->env->xdf1.recs[line - 1].ptr); if (!map->first) map->first = map->entries + index; if (map->last) { @@ -246,8 +246,8 @@ static int find_longest_common_sequence(struct hashmap *map, struct entry **res) static int match(struct hashmap *map, int line1, int line2) { - xrecord_t *record1 = map->env->xdf1.recs[line1 - 1]; - xrecord_t *record2 = map->env->xdf2.recs[line2 - 1]; + xrecord_t *record1 = &map->env->xdf1.recs[line1 - 1]; + xrecord_t *record2 = &map->env->xdf2.recs[line2 - 1]; return record1->ha == record2->ha; } @@ -331,11 +331,11 @@ static int patience_diff(xpparam_t const *xpp, xdfenv_t *env, /* trivial case: one side is empty */ if (!count1) { while(count2--) - env->xdf2.rchg[line2++ - 1] = 1; + env->xdf2.changed[line2++ - 1] = true; return 0; } else if (!count2) { while(count1--) - env->xdf1.rchg[line1++ - 1] = 1; + env->xdf1.changed[line1++ - 1] = true; return 0; } @@ -347,9 +347,9 @@ static int patience_diff(xpparam_t const *xpp, xdfenv_t *env, /* are there any matching lines at all? */ if (!map.has_matches) { while(count1--) - env->xdf1.rchg[line1++ - 1] = 1; + env->xdf1.changed[line1++ - 1] = true; while(count2--) - env->xdf2.rchg[line2++ - 1] = 1; + env->xdf2.changed[line2++ - 1] = true; xdl_free(map.entries); return 0; } |
