diff options
author | Xiao Zeng <zengxiao@eswincomputing.com> | 2024-01-02 13:56:15 +0800 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2024-01-02 14:11:07 -0500 |
commit | 99f3898dfcdcd5de1a3a6093d24ed097291ff4d8 (patch) | |
tree | 4f16a34f0d965d33f2cf60a5acfeca636897f120 /newlib/libc | |
parent | 26f7004bf73c421c3fd5e5a6ccf470d05337b435 (diff) | |
download | newlib-99f3898dfcdcd5de1a3a6093d24ed097291ff4d8.zip newlib-99f3898dfcdcd5de1a3a6093d24ed097291ff4d8.tar.gz newlib-99f3898dfcdcd5de1a3a6093d24ed097291ff4d8.tar.bz2 |
newlib: libc: Improved the readability of strspn with minor optimization
Signed-off-by: Xiao Zeng <zengxiao@eswincomputing.com>
Diffstat (limited to 'newlib/libc')
-rw-r--r-- | newlib/libc/string/strspn.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/newlib/libc/string/strspn.c b/newlib/libc/string/strspn.c index baf2399..bfa3331 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++; } |