4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-21 00:07:36 +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:
Xiao Zeng 2023-12-15 16:31:01 +08:00 committed by Jeff Johnston
parent c1a61029fe
commit b639245932

View File

@ -37,12 +37,10 @@ strcspn (const char *s1,
for (c = s2; *c; c++) for (c = s2; *c; c++)
{ {
if (*s1 == *c) if (*s1 == *c)
break; goto end;
} }
if (*c)
break;
s1++; s1++;
} }
end:
return s1 - s; return s1 - s;
} }