X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=diffcore-rename.c;h=611b08f463d670862605500036db4942c8fbfef4;hb=f0e63c41139f8982add435536d39aff6f3d4ca98;hp=9624864858dcb4e99d793858c3fe4885d18134e3;hpb=d9beb468e6d0c493eed00e365d90a69127488caa;p=thirdparty%2Fgit.git diff --git a/diffcore-rename.c b/diffcore-rename.c index 9624864858..611b08f463 100644 --- a/diffcore-rename.c +++ b/diffcore-rename.c @@ -274,18 +274,17 @@ static int find_identical_files(struct hashmap *srcs, struct diff_options *options) { int renames = 0; - struct diff_filespec *target = rename_dst[dst_index].two; struct file_similarity *p, *best = NULL; int i = 100, best_score = -1; + unsigned int hash = hash_filespec(options->repo, target); /* * Find the best source match for specified destination. */ - p = hashmap_get_from_hash(srcs, - hash_filespec(options->repo, target), - NULL); - for (; p; p = hashmap_get_next(srcs, p)) { + p = hashmap_get_entry_from_hash(srcs, hash, NULL, + struct file_similarity, entry); + hashmap_for_each_entry_from(srcs, p, struct file_similarity, entry) { int score; struct diff_filespec *source = p->filespec; @@ -329,8 +328,8 @@ static void insert_file_table(struct repository *r, entry->index = index; entry->filespec = filespec; - hashmap_entry_init(entry, hash_filespec(r, filespec)); - hashmap_add(table, entry); + hashmap_entry_init(&entry->entry, hash_filespec(r, filespec)); + hashmap_add(table, &entry->entry); } /*