From e510ab898865fdaf131e9bc9fd6ab6b7c4a94c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sat, 24 Oct 2015 18:21:31 +0200 Subject: 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 Signed-off-by: Junio C Hamano --- upload-pack.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'upload-pack.c') diff --git a/upload-pack.c b/upload-pack.c index 89e832b64a..d0bc3ca07a 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -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; -- cgit v1.2.3