Skip to content
  • Karsten Blees's avatar
    diffcore-rename.c: simplify finding exact renames · 7c85f8ac
    Karsten Blees authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    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: default avatarKarsten Blees <blees@dcon.de>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    7c85f8ac