packfile: use oidset for bad objects
commit09ef66179b943d03cbe0bea0603e5f40574695a1
authorRené Scharfe <l.s.r@web.de>
Sat, 11 Sep 2021 20:43:26 +0000 (11 22:43 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 12 Sep 2021 23:14:32 +0000 (12 16:14 -0700)
tree3cab775a4486a21314d5e536aae76c7a76be186e
parent7407d733a4a99cf946cab0c82e03c41dbd305b7c
packfile: use oidset for bad objects

Store the object ID of broken pack entries in an oidset instead of
keeping only their hashes in an unsorted array.  The resulting code is
shorter and easier to read.  It also handles the (hopefully) very rare
case of having a high number of bad objects better.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
midx.c
object-store.h
packfile.c