public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] newlib: libc: Improved the readability of strspn with minor optimization
@ 2024-01-02 19:20 Jeff Johnston
  0 siblings, 0 replies; only message in thread
From: Jeff Johnston @ 2024-01-02 19:20 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=99f3898dfcdcd5de1a3a6093d24ed097291ff4d8

commit 99f3898dfcdcd5de1a3a6093d24ed097291ff4d8
Author: Xiao Zeng <zengxiao@eswincomputing.com>
Date:   Tue Jan 2 13:56:15 2024 +0800

    newlib: libc: Improved the readability of strspn with minor optimization
    
    Signed-off-by: Xiao Zeng <zengxiao@eswincomputing.com>

Diff:
---
 newlib/libc/string/strspn.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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++;
     }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-02 19:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-02 19:20 [newlib-cygwin] newlib: libc: Improved the readability of strspn with minor optimization Jeff Johnston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).