]> git.ipfire.org Git - thirdparty/git.git/commit - pack-bitmap.c
pack-bitmap.c: avoid redundant calls to try_partial_reuse
authorTaylor Blau <me@ttaylorr.com>
Tue, 31 Aug 2021 20:52:19 +0000 (16:52 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Sep 2021 20:56:43 +0000 (13:56 -0700)
commita5f9f24aa0588621770df7f45a48615e238d8e17
tree533ddadae25c43c4d6aa482a407616c02e814e08
parent711260fd60366063e8c5253a83fc4aeb8947dc9d
pack-bitmap.c: avoid redundant calls to try_partial_reuse

try_partial_reuse() is used to mark any bits in the beginning of a
bitmap whose objects can be reused verbatim from the pack they came
from.

Currently this function returns void, and signals nothing to the caller
when bits could not be reused. But multi-pack bitmaps would benefit from
having such a signal, because they may try to pass objects which are in
bounds, but from a pack other than the preferred one.

Any extra calls are noops because of a conditional in
reuse_partial_packfile_from_bitmap(), but those loop iterations can be
avoided by letting try_partial_reuse() indicate when it can't accept any
more bits for reuse, and then listening to that signal.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pack-bitmap.c