summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-02-27 02:10:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2024-02-27 02:10:24 (GMT)
commit274400998b0a2da64d20e9fa95b288bf1403459c (patch)
tree520059d779f2d3e93ab4ba91e4bc9e0bb8d37313 /remote.c
parentcf47fb7ec7e183a1a1e521a540862fba3c2a89eb (diff)
parentf0e578c69cd91a554179c09dab6989f6eb0e2910 (diff)
downloadgit-274400998b0a2da64d20e9fa95b288bf1403459c.zip
git-274400998b0a2da64d20e9fa95b288bf1403459c.tar.gz
git-274400998b0a2da64d20e9fa95b288bf1403459c.tar.bz2
Merge branch 'rs/use-xstrncmpz'
Code clean-up. * rs/use-xstrncmpz: use xstrncmpz()
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/remote.c b/remote.c
index e07b316..9090632 100644
--- a/remote.c
+++ b/remote.c
@@ -105,7 +105,7 @@ static int remotes_hash_cmp(const void *cmp_data UNUSED,
b = container_of(entry_or_key, const struct remote, ent);
if (key)
- return strncmp(a->name, key->str, key->len) || a->name[key->len];
+ return !!xstrncmpz(a->name, key->str, key->len);
else
return strcmp(a->name, b->name);
}
@@ -189,8 +189,7 @@ static int branches_hash_cmp(const void *cmp_data UNUSED,
b = container_of(entry_or_key, const struct branch, ent);
if (key)
- return strncmp(a->name, key->str, key->len) ||
- a->name[key->len];
+ return !!xstrncmpz(a->name, key->str, key->len);
else
return strcmp(a->name, b->name);
}