packfile: refactor hash search with fanout table
authorJonathan Tan <jonathantanmy@google.com>
Tue, 13 Feb 2018 18:39:39 +0000 (10:39 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 15 Feb 2018 21:08:55 +0000 (13:08 -0800)
commitb4e00f7306a160639f047b3421985e8f3d0c6fb1
treef5c1c3ffba403ad4bb1e25bac7e4f2a943a313cf
parent4669e7d68ec8fb6ff3572a1193ae75ae2094b8e6
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