From: "René Scharfe" <l.s.r@web.de>
To: Git List <git@vger.kernel.org>, Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH] dir: use fspathncmp() in pl_hashmap_cmp()
Date: Sat, 8 Oct 2022 13:05:43 +0200 [thread overview]
Message-ID: <cb6ffcdb-d719-7928-96b8-e46482dd141f@web.de> (raw)
From: Jeff King <peff@peff.net>
Call fspathncmp() instead of open-coding it. This shortens the code and
makes it less repetitive.
Signed-off-by: René Scharfe <l.s.r@web.de>
---
From https://lore.kernel.org/git/YSv1XZJvYdYj1JtP@coredump.intra.peff.net/
dir.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/dir.c b/dir.c
index 7d56d68355..28f4c6895b 100644
--- a/dir.c
+++ b/dir.c
@@ -669,9 +669,7 @@ int pl_hashmap_cmp(const void *cmp_data UNUSED,
? ee1->patternlen
: ee2->patternlen;
- if (ignore_case)
- return strncasecmp(ee1->pattern, ee2->pattern, min_len);
- return strncmp(ee1->pattern, ee2->pattern, min_len);
+ return fspathncmp(ee1->pattern, ee2->pattern, min_len);
}
static char *dup_and_filter_pattern(const char *pattern)
--
2.38.0
next reply other threads:[~2022-10-08 11:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-08 11:05 René Scharfe [this message]
2022-10-11 0:19 ` [PATCH] dir: use fspathncmp() in pl_hashmap_cmp() Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cb6ffcdb-d719-7928-96b8-e46482dd141f@web.de \
--to=l.s.r@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).