From f7669676d0e9aedd814645ca82a5b86980fb7740 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sat, 8 Oct 2022 13:05:43 +0200 Subject: dir: use fspathncmp() in pl_hashmap_cmp() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Call fspathncmp() instead of open-coding it. This shortens the code and makes it less repetitive. Signed-off-by: René Scharfe Signed-off-by: Junio C Hamano --- dir.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'dir.c') diff --git a/dir.c b/dir.c index d7cfb08e44..7500ff1622 100644 --- a/dir.c +++ b/dir.c @@ -669,9 +669,7 @@ int pl_hashmap_cmp(const void *unused_cmp_data, ? 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) -- cgit v1.2.3