Skip to content

Commit

Permalink
[PATCH] fetch.c: Remove some duplicated code in process()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
sigprof authored and Junio C Hamano committed Sep 23, 2005
1 parent 51d8faf commit 7b64d06
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 7b64d06

Please sign in to comment.