diff options
author | Jeremiah Mahler <jmmahler@gmail.com> | 2014-06-19 19:06:43 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-06-20 10:08:10 -0700 |
commit | be99ec97c8a1f94e723c6cc5331eff921ae49ed3 (patch) | |
tree | 42bf5a8aa8c0ce9d9173480388c2b9612d36ded4 /name-hash.c | |
parent | cb682f8cfe63ecd0da08a526f404d295e51e3ab1 (diff) | |
download | git-be99ec97c8a1f94e723c6cc5331eff921ae49ed3.tar.gz |
name-hash.c: replace cache_name_compare() with memcmp(3)
The same_name() private function wants a quick-and-exact check to
see if they two names are byte-for-byte identical first and then
fall back to the slow path. Use memcmp(3) for the former to make it
clear that we do not want any "name" specific comparison.
Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'name-hash.c')
-rw-r--r-- | name-hash.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/name-hash.c b/name-hash.c index 97444d0201..49fd508317 100644 --- a/name-hash.c +++ b/name-hash.c @@ -179,7 +179,7 @@ static int same_name(const struct cache_entry *ce, const char *name, int namelen * Always do exact compare, even if we want a case-ignoring comparison; * we do the quick exact one first, because it will be the common case. */ - if (len == namelen && !cache_name_compare(name, namelen, ce->name, len)) + if (len == namelen && !memcmp(name, ce->name, len)) return 1; if (!icase) |