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>
This commit is contained in:
Jeff King 2022-10-08 13:05:43 +02:00 коммит произвёл Junio C Hamano
Родитель a0feb8611d
Коммит f7669676d0
1 изменённых файлов: 1 добавлений и 3 удалений

4
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)