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 <mhag...@alum.mit.edu>
---
 cache-tree.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/cache-tree.c b/cache-tree.c
index 39ad8c9..17db9f9 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -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;
-- 
1.9.0

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to