Skip to content

Commit 5aca024

Browse files
dschogitster
authored andcommitted
cache-tree: avoid an unnecessary check
The first thing the `parse_tree()` function does is to return early if the tree has already been parsed. Therefore we do not need to guard the `parse_tree()` call behind a check of that flag. As of time of writing, there are no other instances of this in Git's code bases: whenever the `parsed` flag guards a `parse_tree()` call, it guards more than just that call. Suggested-by: Patrick Steinhardt <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent aa9f618 commit 5aca024

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cache-tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ static void prime_cache_tree_rec(struct repository *r,
779779
struct cache_tree_sub *sub;
780780
struct tree *subtree = lookup_tree(r, &entry.oid);
781781

782-
if (!subtree->object.parsed && parse_tree(subtree) < 0)
782+
if (parse_tree(subtree) < 0)
783783
exit(128);
784784
sub = cache_tree_sub(it, entry.path);
785785
sub->cache_tree = cache_tree();

0 commit comments

Comments
 (0)