commit 0f1b2b646beb2639f73766f0e505000154892bbd
parent 61b08880c8de61a42897f4680b36cded02dc9e8b
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date: Thu, 25 Nov 2021 15:57:39 +0100
remove questionable optimization from case-insensitive string comparison
we optimized the case where the string would be equal even without
upper-casing, but for the much more common case where the strings differ
even after upper-casing, this was just an additional conditional.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util.c b/src/util.c
@@ -300,7 +300,7 @@ starts_with_upper( const char *str, int strl, const char *cmp, uint cmpl )
if ((uint)strl < cmpl)
return 0;
for (uint i = 0; i < cmpl; i++)
- if (str[i] != cmp[i] && toupper( str[i] ) != cmp[i])
+ if (toupper( str[i] ) != cmp[i])
return 0;
return 1;
}