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>
Michael Haggerty committed
Mar 5, 2014 at 18:26 UTC
72c378d8a618b9a57e4edf12700c51b0af86f124
1 file changed
+3
-4
cache-tree.c
+3
-4
@@ -564,10 +564,9 @@ static struct cache_tree *cache_tree_find(struct cache_tree *it, const char *pat
564
if (!sub)
565
return NULL;
566
it = sub->cache_tree;
567
- if (slash)
568
- while (*slash && *slash == '/')
569
- slash++;
570
- if (!slash || !*slash)
567
+ while (*slash && *slash == '/')
568
+ slash++;
569
+ if (!*slash)
570
return it; /* prefix ended with slashes */
571
path = slash;
572
}