mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-19 07:22:14 +08:00
newlib: libc: Improved the readability of strcspn with minor optimization
Signed-off-by: Xiao Zeng <zengxiao@eswincomputing.com>
This commit is contained in:
parent
c1a61029fe
commit
b639245932
@ -37,12 +37,10 @@ strcspn (const char *s1,
|
||||
for (c = s2; *c; c++)
|
||||
{
|
||||
if (*s1 == *c)
|
||||
break;
|
||||
goto end;
|
||||
}
|
||||
if (*c)
|
||||
break;
|
||||
s1++;
|
||||
}
|
||||
|
||||
end:
|
||||
return s1 - s;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user