aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2026-03-19 17:24:40 +0100
committerJunio C Hamano <gitster@pobox.com>2026-03-19 10:45:41 -0700
commit60d8b5af9b553230faaae4fd276398d4f9fe4e39 (patch)
tree7bba7dc925ff563d14f259ab0d433e07a07c35a4
parent7ff1e8dc1e1680510c96e69965b3fa81372c5037 (diff)
downloadgit-60d8b5af9b553230faaae4fd276398d4f9fe4e39.tar.xz
commit-reach: simplify cleanup of remaining bitmaps in ahead_behind ()
Don't bother extracting the last few remaining prio_queue items in order when we only want to free their associated bitmaps; just iterate over the item array. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-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);
}