diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-04-08 11:43:15 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-04-08 11:43:15 -0700 |
| commit | 9fdf2a0b7e79af06bb6223f35381836cd1d2396b (patch) | |
| tree | 8a240a3b0d6a0b2cd76803ba188e4184713f2561 /commit.c | |
| parent | Merge branch 'tb/incremental-midx-part-2' (diff) | |
| parent | commit: move clear_commit_marks_many() loop body to clear_commit_marks() (diff) | |
| download | git-9fdf2a0b7e79af06bb6223f35381836cd1d2396b.tar.gz git-9fdf2a0b7e79af06bb6223f35381836cd1d2396b.zip | |
Merge branch 'rs/clear-commit-marks-simplify'
Code clean-up.
* rs/clear-commit-marks-simplify:
commit: move clear_commit_marks_many() loop body to clear_commit_marks()
Diffstat (limited to 'commit.c')
| -rw-r--r-- | commit.c | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -780,19 +780,17 @@ static void clear_commit_marks_1(struct commit_list **plist, void clear_commit_marks_many(size_t nr, struct commit **commit, unsigned int mark) { - 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++; - } + for (size_t i = 0; i < nr; i++) + clear_commit_marks(commit[i], mark); } void clear_commit_marks(struct commit *commit, unsigned int mark) { - clear_commit_marks_many(1, &commit, mark); + struct commit_list *list = NULL; + + clear_commit_marks_1(&list, commit, mark); + while (list) + clear_commit_marks_1(&list, pop_commit(&list), mark); } struct commit *pop_commit(struct commit_list **stack) |
