aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-03-30 13:56:58 -0700
committerJunio C Hamano <gitster@pobox.com>2026-03-30 13:56:59 -0700
commitcb7428fd7bfa22e7e08b7a93b45c93ec5fecd3a7 (patch)
tree57c5df8e1270156e384a32d0012b3eb946447e70
parent5361983c075154725be47b65cca9a2421789e410 (diff)
parent60d8b5af9b553230faaae4fd276398d4f9fe4e39 (diff)
downloadgit-cb7428fd7bfa22e7e08b7a93b45c93ec5fecd3a7.tar.xz
Merge branch 'rs/ahead-behind-cleanup-optimization'
The cleanup of remaining bitmaps in "ahead_behind()" has been simplified. * rs/ahead-behind-cleanup-optimization: commit-reach: simplify cleanup of remaining bitmaps in ahead_behind ()
-rw-r--r--commit-reach.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/commit-reach.c b/commit-reach.c
index 9604bbdcce..d3a9b3ed6f 100644
--- a/commit-reach.c
+++ b/commit-reach.c
@@ -1117,10 +1117,8 @@ void ahead_behind(struct repository *r,
/* STALE is used here, PARENT2 is used by insert_no_dup(). */
repo_clear_commit_marks(r, PARENT2 | STALE);
- while (prio_queue_peek(&queue)) {
- struct commit *c = prio_queue_get(&queue);
- free_bit_array(c);
- }
+ for (size_t i = 0; i < queue.nr; i++)
+ free_bit_array(queue.array[i].data);
clear_bit_arrays(&bit_arrays);
clear_prio_queue(&queue);
}