use pop_commit() for consuming the first entry of a struct commit_list
Instead of open-coding the function pop_commit() just call it. This makes the intent clearer and reduces code size. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
24358560c3
commit
e510ab8988
@ -316,10 +316,8 @@ static int reachable(struct commit *want)
|
||||
|
||||
commit_list_insert_by_date(want, &work);
|
||||
while (work) {
|
||||
struct commit_list *list = work->next;
|
||||
struct commit *commit = work->item;
|
||||
free(work);
|
||||
work = list;
|
||||
struct commit_list *list;
|
||||
struct commit *commit = pop_commit(&work);
|
||||
|
||||
if (commit->object.flags & THEY_HAVE) {
|
||||
want->object.flags |= COMMON_KNOWN;
|
||||
|
Reference in New Issue
Block a user