summaryrefslogtreecommitdiff
path: root/cache-tree.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2014-03-05 18:26:25 +0100
committerJunio C Hamano <gitster@pobox.com>2014-03-05 12:33:02 -0800
commit72c378d8a618b9a57e4edf12700c51b0af86f124 (patch)
tree82d2f1188ea58935d427609baec2d3fb2c93a804 /cache-tree.c
parent2f93541d88fadd1ff5307d81c2c8921ee3eea058 (diff)
downloadgit-72c378d8a618b9a57e4edf12700c51b0af86f124.tar.gz
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>
Diffstat (limited to 'cache-tree.c')
-rw-r--r--cache-tree.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/cache-tree.c b/cache-tree.c
index 0bbec43216..4d439bd915 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -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;
}