Skip to content

Commit 07f7d55

Browse files
rscharfegitster
authored andcommitted
commit: avoid allocation in clear_commit_marks_many()
Pass the entries of the commit array directly to clear_commit_marks_1() instead of adding them to a commit_list first. The function clears the commit and any first parent without allocation; only higher numbered parents are added to a list for later treatment. This change extends that optimization to clear_commit_marks_many(). Signed-off-by: Rene Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3013dff commit 07f7d55

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

commit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ void clear_commit_marks_many(int nr, struct commit **commit, unsigned int mark)
547547
struct commit_list *list = NULL;
548548

549549
while (nr--) {
550-
commit_list_insert(*commit, &list);
550+
clear_commit_marks_1(&list, *commit, mark);
551551
commit++;
552552
}
553553
while (list)

0 commit comments

Comments
 (0)