diff.c: get rid of duplicate implementation
commit01be97c2b285e8ba377ba58385ef6ad2e7815c93
authorStefan Beller <sbeller@google.com>
Wed, 25 Oct 2017 18:49:12 +0000 (25 11:49 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 26 Oct 2017 02:23:32 +0000 (26 11:23 +0900)
tree83384828d61d6c06a418e45766a990eebc95ba6a
parent5ec8274b8424f76bf998059e66facff1b241337e
diff.c: get rid of duplicate implementation

The implementations in diff.c to detect moved lines needs to compare
strings and hash strings, which is implemented in that file, as well
as in the xdiff library.

Remove the rather recent implementation in diff.c and rely on the well
exercised code in the xdiff lib.

With this change the hash used for bucketing the strings for the moved
line detection changes from FNV32 (that is provided via the hashmaps
memhash) to DJB2 (which is used internally in xdiff).  Benchmarks found
on the web[1] do not indicate that these hashes are different in
performance for readable strings.

[1] https://softwareengineering.stackexchange.com/questions/49550/which-hashing-algorithm-is-best-for-uniqueness-and-speed

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c