mirror of
https://github.com/git/git.git
synced 2026-02-28 02:42:52 +00:00
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()
This commit is contained in:
16
commit.c
16
commit.c
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user