summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Vlasov <vsu@altlinux.ru>2005-09-21 16:34:14 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-09-23 04:52:11 (GMT)
commit7b64d06b2e74612a0970c8563845cb9ee34724af (patch)
tree585e35f3d602f3e783cb9a63eacb990ef6662083
parent51d8faf8608aa8d2f6a8c4b3c1b712adb0d39325 (diff)
downloadgit-7b64d06b2e74612a0970c8563845cb9ee34724af.zip
git-7b64d06b2e74612a0970c8563845cb9ee34724af.tar.gz
git-7b64d06b2e74612a0970c8563845cb9ee34724af.tar.bz2
[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>
-rw-r--r--fetch.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/fetch.c b/fetch.c
index 390de99..3074f5f 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;
}