Skip to content

Commit 8b7e5f7

Browse files
mhaggergitster
authored andcommitted
cache_tree_find(): remove early return
There is no need for an early return it; from the loop if slash points at the end of the string, because that is exactly what will happen when the while condition fails at the start of the next iteration. Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 03b0403 commit 8b7e5f7

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

cache-tree.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,6 @@ static struct cache_tree *cache_tree_find(struct cache_tree *it, const char *pat
565565
it = sub->cache_tree;
566566
while (*slash == '/')
567567
slash++;
568-
if (!*slash)
569-
return it; /* prefix ended with slashes */
570568
path = slash;
571569
}
572570
return it;

0 commit comments

Comments
 (0)