public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Jeff Johnston <jjohnstn@redhat.com>
To: Xiao Zeng <zengxiao@eswincomputing.com>
Cc: newlib@sourceware.org, palmer@rivosinc.com,
	jeffreyalaw@gmail.com,  torbjorn.svensson@foss.st.com
Subject: Re: [PING^1] [PATCH] newlib: libc: Improved the readability of strspn with minor optimization
Date: Tue, 2 Jan 2024 14:24:14 -0500	[thread overview]
Message-ID: <CAOox84s3nZvvpM=h9LAMT6qMyGtZ-6xfA_DG49ewc__V5cojZg@mail.gmail.com> (raw)
In-Reply-To: <20240102055615.29320-1-zengxiao@eswincomputing.com>

[-- Attachment #1: Type: text/plain, Size: 920 bytes --]

Hello,

I modified the code to change the label to "found" instead of "end" since
"end" is usually used to jump to the end of function as opposed to loop.
Modified code has been merged.

-- Jeff J.

On Tue, Jan 2, 2024 at 12:57 AM Xiao Zeng <zengxiao@eswincomputing.com>
wrote:

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

  reply	other threads:[~2024-01-02 19:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-02  5:56 Xiao Zeng
2024-01-02 19:24 ` Jeff Johnston [this message]
2024-01-03  1:26   ` Xiao Zeng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOox84s3nZvvpM=h9LAMT6qMyGtZ-6xfA_DG49ewc__V5cojZg@mail.gmail.com' \
    --to=jjohnstn@redhat.com \
    --cc=jeffreyalaw@gmail.com \
    --cc=newlib@sourceware.org \
    --cc=palmer@rivosinc.com \
    --cc=torbjorn.svensson@foss.st.com \
    --cc=zengxiao@eswincomputing.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).