Skip to content

Commit cb7428f

Browse files
committed
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 ()
2 parents 5361983 + 60d8b5a commit cb7428f

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

commit-reach.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,10 +1117,8 @@ void ahead_behind(struct repository *r,
11171117

11181118
/* STALE is used here, PARENT2 is used by insert_no_dup(). */
11191119
repo_clear_commit_marks(r, PARENT2 | STALE);
1120-
while (prio_queue_peek(&queue)) {
1121-
struct commit *c = prio_queue_get(&queue);
1122-
free_bit_array(c);
1123-
}
1120+
for (size_t i = 0; i < queue.nr; i++)
1121+
free_bit_array(queue.array[i].data);
11241122
clear_bit_arrays(&bit_arrays);
11251123
clear_prio_queue(&queue);
11261124
}

0 commit comments

Comments
 (0)