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.
This commit is contained in:
Oswald Buddenhagen 2021-11-25 15:57:39 +01:00
parent 61b08880c8
commit 0f1b2b646b

View File

@ -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;
}