mirror of
https://github.com/fluencelabs/musl
synced 2025-06-23 11:41:57 +00:00
strcmp: Remove unnecessary check for *r
If *l == *r && *l, then by transitivity, *r.
This commit is contained in:
committed by
Rich Felker
parent
8ff810d779
commit
b300d5b7bd
@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
int strcmp(const char *l, const char *r)
|
int strcmp(const char *l, const char *r)
|
||||||
{
|
{
|
||||||
for (; *l==*r && *l && *r; l++, r++);
|
for (; *l==*r && *l; l++, r++);
|
||||||
return *(unsigned char *)l - *(unsigned char *)r;
|
return *(unsigned char *)l - *(unsigned char *)r;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user