assume parse_commit checks commit->object.parsed
The parse_commit function will check the "parsed" flag of the object and do nothing if it is set. There is no need for callers to check the flag themselves, and doing so only clutters the code. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
7059dccc6c
commit
0064053bd7
@ -46,9 +46,8 @@ static void rev_list_push(struct commit *commit, int mark)
|
||||
if (!(commit->object.flags & mark)) {
|
||||
commit->object.flags |= mark;
|
||||
|
||||
if (!(commit->object.parsed))
|
||||
if (parse_commit(commit))
|
||||
return;
|
||||
if (parse_commit(commit))
|
||||
return;
|
||||
|
||||
prio_queue_put(&rev_list, commit);
|
||||
|
||||
@ -127,8 +126,7 @@ static const unsigned char *get_rev(void)
|
||||
return NULL;
|
||||
|
||||
commit = prio_queue_get(&rev_list);
|
||||
if (!commit->object.parsed)
|
||||
parse_commit(commit);
|
||||
parse_commit(commit);
|
||||
parents = commit->parents;
|
||||
|
||||
commit->object.flags |= POPPED;
|
||||
|
||||
Reference in New Issue
Block a user