From 95500a936a1b0e42d304315fd2f7ae20ca391042 Mon Sep 17 00:00:00 2001 From: Omar Polo Date: Fri, 11 Aug 2023 10:38:34 +0000 Subject: remove not so useful starts_with() replace its only usage with strncmp(). it's likely faster too. --- utils.c | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'utils.c') diff --git a/utils.c b/utils.c index 4485f89..f75fa1c 100644 --- a/utils.c +++ b/utils.c @@ -46,20 +46,6 @@ strip_path(const char *path, int strip) return path; } -int -starts_with(const char *str, const char *prefix) -{ - size_t i; - - if (prefix == NULL) - return 0; - - for (i = 0; prefix[i] != '\0'; ++i) - if (str[i] != prefix[i]) - return 0; - return 1; -} - int ends_with(const char *str, const char *sufx) { -- cgit v1.2.3