OSDN Git Service

cache_tree_find(): remove early return
authorMichael Haggerty <mhagger@alum.mit.edu>
Wed, 5 Mar 2014 17:26:29 +0000 (18:26 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Mar 2014 20:34:05 +0000 (12:34 -0800)
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 <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache-tree.c

index 39ad8c9..17db9f9 100644 (file)
@@ -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;