diffcore-rename.c: simplify finding exact renames
commit7c85f8acb2282e3ed108c46b59fd5daa78bf17db
authorKarsten Blees <karsten.blees@gmail.com>
Thu, 14 Nov 2013 19:19:34 +0000 (14 20:19 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 Nov 2013 21:04:23 +0000 (18 13:04 -0800)
tree10eb91593d592c1a76ed0a4eeba12b74ee5598c0
parent48f6407ffec1db18f5ef3316f0d761965bb17f1e
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 <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diffcore-rename.c