@matheusbsbs / matheus-bagliano / commits / 7b64d06b2e
Fork 0

[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 <vsu@altlinux.ru> Signed-off-by: Junio C Hamano <junkio@cox.net>

Sergey Vlasov committed Sep 21, 2005 at 20:34 UTC 7b64d06b2e74612a0970c8563845cb9ee34724af
1 file changed +5 -8
fetch.c
+5 -8
@@ -138,18 +138,15 @@ static int process(struct object *obj)
138 /* We already have it, so we should scan it now. */
139 if (obj->flags & TO_SCAN)
140 return 0;
141 - object_list_insert(obj, process_queue_end);
142 - process_queue_end = &(*process_queue_end)->next;
141 obj->flags |= TO_SCAN;
144 - return 0;
142 + } else {
143 + if (obj->flags & COMPLETE)
144 + return 0;
145 + prefetch(obj->sha1);
146 }
146 - if (obj->flags & COMPLETE)
147 - return 0;
147 +
148 object_list_insert(obj, process_queue_end);
149 process_queue_end = &(*process_queue_end)->next;
150 -
151 - prefetch(obj->sha1);
152 -
150 return 0;
151 }
152