1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-18 06:36:09 +02:00

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 <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
René Scharfe 2017-12-25 18:43:37 +01:00 committed by Junio C Hamano
parent 3013dff866
commit 07f7d55a34

View File

@ -547,7 +547,7 @@ void clear_commit_marks_many(int nr, struct commit **commit, unsigned int mark)
struct commit_list *list = NULL;
while (nr--) {
commit_list_insert(*commit, &list);
clear_commit_marks_1(&list, *commit, mark);
commit++;
}
while (list)