From: Karsten Blees Date: Thu, 14 Nov 2013 19:19:34 +0000 (+0100) Subject: diffcore-rename.c: simplify finding exact renames X-Git-Tag: v2.0.0-rc0~166^2~13 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/7c85f8acb2282e3ed108c46b59fd5daa78bf17db?ds=inline;hp=7c85f8acb2282e3ed108c46b59fd5daa78bf17db diffcore-rename.c: simplify finding exact renames The find_exact_renames function currently only uses the hash table for grouping, i.e.: 1. add sources 2. add destinations 3. iterate all buckets, per bucket: 4. split sources from destinations 5. iterate destinations, per destination: 6. iterate sources to find best match This can be simplified by utilizing the lookup functionality of the hash table, i.e.: 1. add sources 2. iterate destinations, per destination: 3. lookup sources matching the current destination 4. iterate sources to find best match This saves several iterations and file_similarity allocations for the destinations. Signed-off-by: Karsten Blees Signed-off-by: Junio C Hamano ---