summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2017-12-25 17:43:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-12-28 21:50:05 (GMT)
commit07f7d55a346f0eb73a358736ce065f8c08b46452 (patch)
treebf14544942a058b19df3530c5eee5eaa717114ad /commit.c
parent3013dff8662eae06457fe6e5348dfe2270810ab2 (diff)
downloadgit-07f7d55a346f0eb73a358736ce065f8c08b46452.zip
git-07f7d55a346f0eb73a358736ce065f8c08b46452.tar.gz
git-07f7d55a346f0eb73a358736ce065f8c08b46452.tar.bz2
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>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commit.c b/commit.c
index cab8d44..8266751 100644
--- a/commit.c
+++ b/commit.c
@@ -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)