Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-08-22 20:29:11 +0300
committerJunio C Hamano <gitster@pobox.com>2017-08-22 20:29:12 +0300
commit3717f91c5a1afd45b15e255d6dc38431b020f8bf (patch)
treea2d5b0c43b0869ffee9f09936a3e7eb9beee8f8c /sha1_file.c
parent1168df9a9c1134b3041c0ffb1f8019a88f51cdb5 (diff)
parent6355a768023e7c6d0ec11f2e8cdd2b7501daa516 (diff)
Merge branch 'rs/find-pack-entry-bisection'
Code clean-up. * rs/find-pack-entry-bisection: sha1_file: avoid comparison if no packed hash matches the first byte
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sha1_file.c b/sha1_file.c
index ccf6fcf4ec..607b34ea53 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2788,7 +2788,7 @@ off_t find_pack_entry_one(const unsigned char *sha1,
printf("%02x%02x%02x... lo %u hi %u nr %"PRIu32"\n",
sha1[0], sha1[1], sha1[2], lo, hi, p->num_objects);
- do {
+ while (lo < hi) {
unsigned mi = (lo + hi) / 2;
int cmp = hashcmp(index + mi * stride, sha1);
@@ -2801,7 +2801,7 @@ off_t find_pack_entry_one(const unsigned char *sha1,
hi = mi;
else
lo = mi+1;
- } while (lo < hi);
+ }
return 0;
}