packfile: refactor hash search with fanout table
authorJonathan Tan <jonathantanmy@google.com>
Fri, 2 Feb 2018 22:36:31 +0000 (14:36 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 2 Feb 2018 23:33:41 +0000 (15:33 -0800)
commit17188a038ed6ddec19d3f88c7bf5533ca0decf48
tree9c6336d8a9c9f5a8839b95924301778079fe6984
parenta74f6c1a35e6f91834c7cc59cdc17d10c745b43c
packfile: refactor hash search with fanout table

Subsequent patches will introduce file formats that make use of a fanout
array and a sorted table containing hashes, just like packfiles.
Refactor the hash search in packfile.c into its own function, so that
those patches can make use of it as well.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
packfile.c
sha1-lookup.c
sha1-lookup.h