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:
parent
61b08880c8
commit
0f1b2b646b
|
@ -300,7 +300,7 @@ starts_with_upper( const char *str, int strl, const char *cmp, uint cmpl )
|
||||||
if ((uint)strl < cmpl)
|
if ((uint)strl < cmpl)
|
||||||
return 0;
|
return 0;
|
||||||
for (uint i = 0; i < cmpl; i++)
|
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 0;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user