aboutsummaryrefslogtreecommitdiffstats
path: root/bisect.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-09-12 11:47:23 -0700
committerJunio C Hamano <gitster@pobox.com>2024-09-12 11:47:23 -0700
commit143682ec43d5772ee9327ed84eb0cdc007b1f489 (patch)
treef31ec1d5710d11b704afef67f270152226e8b537 /bisect.c
parent3bf057a0cd6a75125a5bd239372f9fc4fea6c338 (diff)
parentc3459ae9ef26ee1b49d4de0af128444967910361 (diff)
downloadgit-143682ec43d5772ee9327ed84eb0cdc007b1f489.tar.gz
Merge branch 'ps/pack-refs-auto-heuristics'
"git pack-refs --auto" for the files backend was too aggressive, which has been a bit tamed. * ps/pack-refs-auto-heuristics: refs/files: use heuristic to decide whether to repack with `--auto` t0601: merge tests for auto-packing of refs wrapper: introduce `log2u()`
Diffstat (limited to 'bisect.c')
-rw-r--r--bisect.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/bisect.c b/bisect.c
index 4406fc44cf..4713226fad 100644
--- a/bisect.c
+++ b/bisect.c
@@ -1130,16 +1130,6 @@ cleanup:
return res;
}
-static inline int log2i(int n)
-{
- int log2 = 0;
-
- for (; n > 1; n >>= 1)
- log2++;
-
- return log2;
-}
-
static inline int exp2i(int n)
{
return 1 << n;
@@ -1162,7 +1152,7 @@ int estimate_bisect_steps(int all)
if (all < 3)
return 0;
- n = log2i(all);
+ n = log2u(all);
e = exp2i(n);
x = all - e;