dir: use fspathncmp() in pl_hashmap_cmp()
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Oct 8, 2022 at 13:05 UTC
f7669676d0e9aedd814645ca82a5b86980fb7740
1 file changed
+1
-3
dir.c
+1
-3
@@ -669,9 +669,7 @@ int pl_hashmap_cmp(const void *unused_cmp_data,
669
? ee1->patternlen
670
: ee2->patternlen;
671
672
- if (ignore_case)
673
- return strncasecmp(ee1->pattern, ee2->pattern, min_len);
674
- return strncmp(ee1->pattern, ee2->pattern, min_len);
672
+ return fspathncmp(ee1->pattern, ee2->pattern, min_len);
673
}
674
675
static char *dup_and_filter_pattern(const char *pattern)