Skip to content

Commit f766967

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a0feb86 commit f766967

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

dir.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -669,9 +669,7 @@ int pl_hashmap_cmp(const void *unused_cmp_data,
669669
? ee1->patternlen
670670
: ee2->patternlen;
671671

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);
675673
}
676674

677675
static char *dup_and_filter_pattern(const char *pattern)

0 commit comments

Comments
 (0)