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 <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Michael Haggerty 2014-03-05 18:26:29 +01:00 committed by Junio C Hamano
parent 03b0403b4a
commit 8b7e5f7972

View file

@ -565,8 +565,6 @@ static struct cache_tree *cache_tree_find(struct cache_tree *it, const char *pat
it = sub->cache_tree;
while (*slash == '/')
slash++;
if (!*slash)
return it; /* prefix ended with slashes */
path = slash;
}
return it;