]> git.ipfire.org Git - thirdparty/git.git/blobdiff - diff.c
hashmap_get_next takes "const struct hashmap_entry *"
[thirdparty/git.git] / diff.c
diff --git a/diff.c b/diff.c
index efe42b341ae15ebceb1e216518ab3a542be361dc..1168f0cbb94c00ce78ad5c2721a3c6a6151d3946 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -964,8 +964,9 @@ static struct moved_entry *prepare_entry(struct diff_options *o,
        struct moved_entry *ret = xmalloc(sizeof(*ret));
        struct emitted_diff_symbol *l = &o->emitted_symbols->buf[line_no];
        unsigned flags = o->color_moved_ws_handling & XDF_WHITESPACE_FLAGS;
+       unsigned int hash = xdiff_hash_string(l->line, l->len, flags);
 
-       ret->ent.hash = xdiff_hash_string(l->line, l->len, flags);
+       hashmap_entry_init(&ret->ent, hash);
        ret->es = l;
        ret->next_line = NULL;
 
@@ -1035,7 +1036,7 @@ static void pmb_advance_or_null_multi_match(struct diff_options *o,
        int i;
        char *got_match = xcalloc(1, pmb_nr);
 
-       for (; match; match = hashmap_get_next(hm, match)) {
+       for (; match; match = hashmap_get_next(hm, &match->ent)) {
                for (i = 0; i < pmb_nr; i++) {
                        struct moved_entry *prev = pmb[i].match;
                        struct moved_entry *cur = (prev && prev->next_line) ?
@@ -1188,7 +1189,8 @@ static void mark_color_as_moved(struct diff_options *o,
                         * The current line is the start of a new block.
                         * Setup the set of potential blocks.
                         */
-                       for (; match; match = hashmap_get_next(hm, match)) {
+                       for (; match; match = hashmap_get_next(hm,
+                                                               &match->ent)) {
                                ALLOC_GROW(pmb, pmb_nr + 1, pmb_alloc);
                                if (o->color_moved_ws_handling &
                                    COLOR_MOVED_WS_ALLOW_INDENTATION_CHANGE) {