Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorXiao Zeng <zengxiao@eswincomputing.com>2024-01-02 08:56:15 +0300
committerJeff Johnston <jjohnstn@redhat.com>2024-01-02 22:11:07 +0300
commit99f3898dfcdcd5de1a3a6093d24ed097291ff4d8 (patch)
tree4f16a34f0d965d33f2cf60a5acfeca636897f120 /newlib
parent26f7004bf73c421c3fd5e5a6ccf470d05337b435 (diff)
newlib: libc: Improved the readability of strspn with minor optimization
Signed-off-by: Xiao Zeng <zengxiao@eswincomputing.com>
Diffstat (limited to 'newlib')
-rw-r--r--newlib/libc/string/strspn.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/newlib/libc/string/strspn.c b/newlib/libc/string/strspn.c
index baf239947..bfa3331cd 100644
--- a/newlib/libc/string/strspn.c
+++ b/newlib/libc/string/strspn.c
@@ -41,10 +41,11 @@ strspn (const char *s1,
for (c = s2; *c; c++)
{
if (*s1 == *c)
- break;
+ goto found;
}
if (*c == '\0')
break;
+found:
s1++;
}