Skip to content

Commit c580ce1

Browse files
committed
Merge branch 'rs/find-pack-entry-bisection' into maint
Code clean-up. * rs/find-pack-entry-bisection: sha1_file: avoid comparison if no packed hash matches the first byte
2 parents c7759cd + 6355a76 commit c580ce1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sha1_file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2800,7 +2800,7 @@ off_t find_pack_entry_one(const unsigned char *sha1,
28002800
return nth_packed_object_offset(p, pos);
28012801
}
28022802

2803-
do {
2803+
while (lo < hi) {
28042804
unsigned mi = (lo + hi) / 2;
28052805
int cmp = hashcmp(index + mi * stride, sha1);
28062806

@@ -2813,7 +2813,7 @@ off_t find_pack_entry_one(const unsigned char *sha1,
28132813
hi = mi;
28142814
else
28152815
lo = mi+1;
2816-
} while (lo < hi);
2816+
}
28172817
return 0;
28182818
}
28192819

0 commit comments

Comments
 (0)