提交 7b64d06b 编写于 作者: S Sergey Vlasov 提交者: Junio C Hamano

[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: NSergey Vlasov <vsu@altlinux.ru>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 51d8faf8
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册