[PATCH v1 2/3] pack-bitmap.c: add "break" statement in "open_pack_bitmap()"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux