forked from len0rd/rockbox
strcasecmp: Optimize size and speed
Applies changes similar to strncasecmp in 64c0cfb0
.
Change-Id: I5f80b0031dd12c58d982578f5c5224c7f59cd915
This commit is contained in:
parent
3e92a11618
commit
e08b8fcc74
1 changed files with 7 additions and 5 deletions
|
@ -5,12 +5,14 @@
|
|||
#ifndef strcasecmp
|
||||
int strcasecmp(const char *s1, const char *s2)
|
||||
{
|
||||
while (*s1 != '\0' && tolower(*s1) == tolower(*s2)) {
|
||||
s1++;
|
||||
s2++;
|
||||
int d, c1, c2;
|
||||
do
|
||||
{
|
||||
c1 = tolower(*s1++);
|
||||
c2 = tolower(*s2++);
|
||||
}
|
||||
|
||||
return tolower(*(unsigned char *) s1) - tolower(*(unsigned char *) s2);
|
||||
while ((d = c1 - c2) == 0 && c1 && c2);
|
||||
return d;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue