diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-02-27 15:23:00 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-02-27 15:23:00 -0800 |
| commit | 16b2e579f91cddb672bc63612d516d65c8be0a7c (patch) | |
| tree | ff9bbeb07e5897a1bd2813451dd59660ad8fd34f | |
| parent | Merge branch 'pw/rebase-i-ff-empty-commit' (diff) | |
| parent | commit: avoid parent list buildup in clear_commit_marks_many() (diff) | |
| download | git-16b2e579f91cddb672bc63612d516d65c8be0a7c.tar.gz git-16b2e579f91cddb672bc63612d516d65c8be0a7c.zip | |
Merge branch 'rs/clear-commit-marks-optim'
A micro-optimization.
* rs/clear-commit-marks-optim:
commit: avoid parent list buildup in clear_commit_marks_many()
| -rw-r--r-- | commit.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -780,14 +780,14 @@ static void clear_commit_marks_1(struct commit_list **plist, void clear_commit_marks_many(size_t nr, struct commit **commit, unsigned int mark) { - struct commit_list *list = NULL; - for (size_t i = 0; i < nr; i++) { + struct commit_list *list = NULL; + clear_commit_marks_1(&list, *commit, mark); + while (list) + clear_commit_marks_1(&list, pop_commit(&list), mark); commit++; } - while (list) - clear_commit_marks_1(&list, pop_commit(&list), mark); } void clear_commit_marks(struct commit *commit, unsigned int mark) |
