public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PING^1] [PATCH] newlib: libc: Improved the readability of strspn with minor optimization
@ 2024-01-02  5:56 Xiao Zeng
  2024-01-02 19:24 ` Jeff Johnston
  0 siblings, 1 reply; 3+ messages in thread
From: Xiao Zeng @ 2024-01-02  5:56 UTC (permalink / raw)
  To: newlib; +Cc: jjohnstn, palmer, jeffreyalaw, torbjorn.svensson, Xiao Zeng

Signed-off-by: Xiao Zeng <zengxiao@eswincomputing.com>
---
 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..9d46ce2eb 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 end;
 	}
       if (*c == '\0')
 	break;
+end:
       s1++;
     }
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-03  1:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-02  5:56 [PING^1] [PATCH] newlib: libc: Improved the readability of strspn with minor optimization Xiao Zeng
2024-01-02 19:24 ` Jeff Johnston
2024-01-03  1:26   ` Xiao Zeng

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).