mirror of
https://github.com/git/git
synced 2024-10-06 00:29:28 +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:
parent
2f93541d88
commit
72c378d8a6
|
@ -564,10 +564,9 @@ static struct cache_tree *cache_tree_find(struct cache_tree *it, const char *pat
|
||||||
if (!sub)
|
if (!sub)
|
||||||
return NULL;
|
return NULL;
|
||||||
it = sub->cache_tree;
|
it = sub->cache_tree;
|
||||||
if (slash)
|
|
||||||
while (*slash && *slash == '/')
|
while (*slash && *slash == '/')
|
||||||
slash++;
|
slash++;
|
||||||
if (!slash || !*slash)
|
if (!*slash)
|
||||||
return it; /* prefix ended with slashes */
|
return it; /* prefix ended with slashes */
|
||||||
path = slash;
|
path = slash;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue