From 7b64d06b2e74612a0970c8563845cb9ee34724af Mon Sep 17 00:00:00 2001 From: Sergey Vlasov Date: Wed, 21 Sep 2005 20:34:14 +0400 Subject: [PATCH] [PATCH] fetch.c: Remove some duplicated code in process() It does not matter if we call prefetch() or set the TO_SCAN flag before or after adding the object to process_queue. However, doing it before object_list_insert() allows us to kill 3 lines of duplicated code. Signed-off-by: Sergey Vlasov Signed-off-by: Junio C Hamano --- fetch.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/fetch.c b/fetch.c index 390de99f2a..3074f5f356 100644 --- a/fetch.c +++ b/fetch.c @@ -138,18 +138,15 @@ static int process(struct object *obj) /* We already have it, so we should scan it now. */ if (obj->flags & TO_SCAN) return 0; - object_list_insert(obj, process_queue_end); - process_queue_end = &(*process_queue_end)->next; obj->flags |= TO_SCAN; - return 0; + } else { + if (obj->flags & COMPLETE) + return 0; + prefetch(obj->sha1); } - if (obj->flags & COMPLETE) - return 0; + object_list_insert(obj, process_queue_end); process_queue_end = &(*process_queue_end)->next; - - prefetch(obj->sha1); - return 0; }