[PATCH v1 2/3] pack-bitmap.c: add "break" statement in "open_pack_bitmap()"
- From
Teng Long <dyroneteng@gmail.com>
- Date
- Mar 24, 2022, 11:44 UTC
- Message-ID
- <70500b63434f6e454631b3a8fde07c62b5adfef0.1648119652.git.dyroneteng@gmail.com>
- In-Reply-To
- <cover.1648119652.git.dyroneteng@gmail.com>
There will be only one operant ".bitmap" file in repo, so let's add "break" statement in "open_pack_bitmap()" when looping all the packs in repo.
Signed-off-by: Teng Long <dyroneteng@gmail.com> --- pack-bitmap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pack-bitmap.c b/pack-bitmap.c index 931219adf0..b1357137bf 100644 --- a/pack-bitmap.c +++ b/pack-bitmap.c @@ -484,8 +484,10 @@ static int open_pack_bitmap(struct repository *r, assert(!bitmap_git->map); for (p = get_all_packs(r); p; p = p->next) { - if (open_pack_bitmap_1(bitmap_git, p) == 0) + if (open_pack_bitmap_1(bitmap_git, p) == 0) { ret = 0; + break; + } } return ret;
-- 2.35.1.579.g70500b6343.dirty