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 --- shallow.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'shallow.c') diff --git a/shallow.c b/shallow.c index 257d8115c..889fad913 100644 --- a/shallow.c +++ b/shallow.c @@ -422,13 +422,9 @@ static void paint_down(struct paint_info *info, const unsigned char *sha1, commit_list_insert(c, &head); while (head) { struct commit_list *p; - struct commit *c = head->item; + struct commit *c = pop_commit(&head); uint32_t **refs = ref_bitmap_at(&info->ref_bitmap, c); - p = head; - head = head->next; - free(p); - /* XXX check "UNINTERESTING" from pack bitmaps if available */ if (c->object.flags & (SEEN | UNINTERESTING)) continue; -- cgit v1.2.1