]> sourceware.org Git - newlib-cygwin.git/commitdiff
newlib: libc: Improved the readability of strcspn with minor optimization
authorXiao Zeng <zengxiao@eswincomputing.com>
Fri, 15 Dec 2023 08:31:01 +0000 (16:31 +0800)
committerJeff Johnston <jjohnstn@redhat.com>
Wed, 20 Dec 2023 04:23:31 +0000 (23:23 -0500)
Signed-off-by: Xiao Zeng <zengxiao@eswincomputing.com>
newlib/libc/string/strcspn.c

index abaa93ad67ebcba6200965d15a7b75d36b71787f..8ac0bf10cff1bd4c779b3aae5578b2be7ed0ba46 100644 (file)
@@ -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;
 }
This page took 0.032805 seconds and 5 git commands to generate.