pack-bitmap: drop "loaded" flag
commit199c86be1623ab5053b4ed0ce6ed2ae974e3e859
authorJeff King <peff@peff.net>
Sat, 1 Sep 2018 07:50:57 +0000 (1 03:50 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 4 Sep 2018 15:40:14 +0000 (4 08:40 -0700)
tree5ad5090b018fba30f1eecd290c4c3df993aa1093
parent715d0c50e1ba479290d9fcb34119d8f9a09bfed3
pack-bitmap: drop "loaded" flag

In the early days of the bitmap code, there was a single
static bitmap_index struct that was used behind the scenes,
and any bitmap-related functions could lazily check
bitmap_git.loaded to see if they needed to read the on-disk
data.

But since 3ae5fa0768 (pack-bitmap: remove bitmap_git global
variable, 2018-06-07), the caller is responsible for the
lifetime of the bitmap_index struct, and we return it from
prepare_bitmap_git() and prepare_bitmap_walk(), both of
which load the on-disk data (or return NULL).

So outside of these functions, it's not possible to have a
bitmap_index for which the loaded flag is not true. Nor is
it possible to accidentally pass an already-loaded
bitmap_index to the loading function (which is static-local
to the file).

We can drop this unnecessary and confusing flag.

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