1
0
mirror of https://github.com/git/git synced 2024-07-05 00:58:49 +00:00

cache_tree_find(): remove redundant checks

slash is initialized to a value that cannot be NULL.  So remove the
guards against slash == NULL later in the loop.

Suggested-by: David Kastrup <dak@gnu.org>
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:25 +01:00 committed by Junio C Hamano
parent 2f93541d88
commit 72c378d8a6

View File

@ -564,10 +564,9 @@ static struct cache_tree *cache_tree_find(struct cache_tree *it, const char *pat
if (!sub)
return NULL;
it = sub->cache_tree;
if (slash)
while (*slash && *slash == '/')
slash++;
if (!slash || !*slash)
while (*slash && *slash == '/')
slash++;
if (!*slash)
return it; /* prefix ended with slashes */
path = slash;
}