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 --- remote.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'remote.c') diff --git a/remote.c b/remote.c index 26504b7447..ee6edfa335 100644 --- a/remote.c +++ b/remote.c @@ -1975,10 +1975,8 @@ int resolve_remote_symref(struct ref *ref, struct ref *list) static void unmark_and_free(struct commit_list *list, unsigned int mark) { while (list) { - struct commit_list *temp = list; - temp->item->object.flags &= ~mark; - list = temp->next; - free(temp); + struct commit *commit = pop_commit(&list); + commit->object.flags &= ~mark; } } -- cgit v1.2.3