From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id C97403858D32 for ; Tue, 2 Jan 2024 19:24:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C97403858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C97403858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704223473; cv=none; b=J7IaMC8W895MHBXBIgrkzhMOWe4W4SS8c+La6usYtPBzQ4OF9iff+/8LQ5GEE1mYl6HsOLONPTbTxDSouSBS/8ck4WFS+7r118IqFB6TyHl+aGs6YZVEsszG32fA0ruhP4XOg3smNU73VuKNb988DRbYbjBEUu1c2x2CzGtpYVc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704223473; c=relaxed/simple; bh=+Zl3QWTjyOCTg/envlYsHwkzDEfuihaUyHUTD2RT4DE=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=Vzg48JtfH1c3fIXBdECvoydIaIa/B8QNwNr5Do5ofj7j1EBeK3C737dSW5R1aDzt5q/t1teM8nHWLAetBMB+3OtWBbPXbAGJoqB18EmnV+VeqE7U0n7ThQjOnxNUgs3ubQpn0kAaphV4HPu/cUO7m1vWsv86F4nJsdLKbK3iUfY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704223471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gGDXlU9ivbMtRuShgscrQoLPd9pwrlMWNZSLhNqLCts=; b=BDOyL0h0j03LWbjqkdftw6Gq8z3jSCu8Op9WTRT7WWLQLDT8Asj2mQL3oNcYQet1gA8MIB 3BTxp8oe5WodPNrSxYfM+PN/QRlXlfToezLvykCnYOFAsuJHgu32CbOueugCdeTxVDOt0g SaMwdfQrMSAioB/zD0tS9EeaR/+6F3Y= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-423-gBj4EVDsN_uALf65RRNQWw-1; Tue, 02 Jan 2024 14:24:29 -0500 X-MC-Unique: gBj4EVDsN_uALf65RRNQWw-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2ccc26bec6dso12025581fa.0 for ; Tue, 02 Jan 2024 11:24:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704223467; x=1704828267; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gGDXlU9ivbMtRuShgscrQoLPd9pwrlMWNZSLhNqLCts=; b=RjNjLzHBLXQ9vMCf0gdozr18IRY0H4Z91JMYgsrIDu5MBs7/RtuuXLlC99dNB3jb8j oiklLOUkfccjV/XvTRWJqVPGcNA5Al4DfUhDEfnQ/Rp5XlYw9MxYGRghxGLP5w7F3nUE pcVh6ZlRxlrLv9g58INJ4VNS2PnUAiFHJ+nQuHNiOWIUeGhaTaW5DZ7e5GO1AE6nMupp B8bjWLPnToUoJ3AWAb8sxssxaw1CvuTc5+5mbk3coikigegBBKDC623mY90ijq4j8c5h YAjdcwMsNTLvOlGoOHNgSpnMnv7rnlJ29bOSKxjg1FRkAPw/Vzikb1XnaDj+s3jolBN7 gKRA== X-Gm-Message-State: AOJu0YwIuPUox5yc7MoWy2aCYXZVdllW3PC884l+wjq9LuWqxCjUhhY7 LKWME3mjbg4hpZ50KjBDXarOpCoNxzkmeMkJRGZLuXotfvVUDat2GTzGL/qxlcqF8p2dAc8Lib7 e1EV6kDr1DKxSJEcYw0UZD3PTkzmwlrkzeZrBs5O15JyYvYI= X-Received: by 2002:a05:651c:b27:b0:2cd:db4:e432 with SMTP id b39-20020a05651c0b2700b002cd0db4e432mr1815305ljr.4.1704223467448; Tue, 02 Jan 2024 11:24:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IEhheFMcQXPGwjQUVuPrwpVr0vNNcEIdW9nTVhCmPUY5l3VYOwypn76qzhUF5JmghuV2un9mwuVFn2METqLy/U= X-Received: by 2002:a05:651c:b27:b0:2cd:db4:e432 with SMTP id b39-20020a05651c0b2700b002cd0db4e432mr1815273ljr.4.1704223466297; Tue, 02 Jan 2024 11:24:26 -0800 (PST) MIME-Version: 1.0 References: <20240102055615.29320-1-zengxiao@eswincomputing.com> In-Reply-To: <20240102055615.29320-1-zengxiao@eswincomputing.com> From: Jeff Johnston Date: Tue, 2 Jan 2024 14:24:14 -0500 Message-ID: Subject: Re: [PING^1] [PATCH] newlib: libc: Improved the readability of strspn with minor optimization To: Xiao Zeng Cc: newlib@sourceware.org, palmer@rivosinc.com, jeffreyalaw@gmail.com, torbjorn.svensson@foss.st.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="00000000000060be08060dfb72a7" X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --00000000000060be08060dfb72a7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=E2=80=AFAM Xiao Zeng wrote: > Signed-off-by: Xiao Zeng > --- > 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 =3D s2; *c; c++) > { > if (*s1 =3D=3D *c) > - break; > + goto end; > } > if (*c =3D=3D '\0') > break; > +end: > s1++; > } > > -- > 2.17.1 > > --00000000000060be08060dfb72a7--