Skip to content

Commit 9fdf2a0

Browse files
committed
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()
2 parents 23ee506 + 98b423b commit 9fdf2a0

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

commit.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -780,19 +780,17 @@ static void clear_commit_marks_1(struct commit_list **plist,
780780

781781
void clear_commit_marks_many(size_t nr, struct commit **commit, unsigned int mark)
782782
{
783-
for (size_t i = 0; i < nr; i++) {
784-
struct commit_list *list = NULL;
785-
786-
clear_commit_marks_1(&list, *commit, mark);
787-
while (list)
788-
clear_commit_marks_1(&list, pop_commit(&list), mark);
789-
commit++;
790-
}
783+
for (size_t i = 0; i < nr; i++)
784+
clear_commit_marks(commit[i], mark);
791785
}
792786

793787
void clear_commit_marks(struct commit *commit, unsigned int mark)
794788
{
795-
clear_commit_marks_many(1, &commit, mark);
789+
struct commit_list *list = NULL;
790+
791+
clear_commit_marks_1(&list, commit, mark);
792+
while (list)
793+
clear_commit_marks_1(&list, pop_commit(&list), mark);
796794
}
797795

798796
struct commit *pop_commit(struct commit_list **stack)

0 commit comments

Comments
 (0)