From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2134) id D9FB03858D32; Tue, 2 Jan 2024 19:20:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9FB03858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1704223242; bh=hXM4I2x4GWBXaniYKnT/aPcPAyJpSKkldnRkr9QvAOQ=; h=From:To:Subject:Date:From; b=j4rKg3Wr6oIIfagPEQNhxyc9N6ubuCP7TW9/bsZ0rCCCwGrMHZAp/T1MXCq6FluSf QTI0Bhp//+8ertobm1aWy/6vrK8hhBWiN9Yzrf9em7WWLtGHeEagYu9e1ZdYRbYAVS pirbHbObjD2GHJLCFj+n9d/SGnKdbQoBlw6fhTq4= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jeff Johnston To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] newlib: libc: Improved the readability of strspn with minor optimization X-Act-Checkin: newlib-cygwin X-Git-Author: Xiao Zeng X-Git-Refname: refs/heads/master X-Git-Oldrev: 26f7004bf73c421c3fd5e5a6ccf470d05337b435 X-Git-Newrev: 99f3898dfcdcd5de1a3a6093d24ed097291ff4d8 Message-Id: <20240102192042.D9FB03858D32@sourceware.org> Date: Tue, 2 Jan 2024 19:20:42 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D99f3898dfcd= cd5de1a3a6093d24ed097291ff4d8 commit 99f3898dfcdcd5de1a3a6093d24ed097291ff4d8 Author: Xiao Zeng Date: Tue Jan 2 13:56:15 2024 +0800 newlib: libc: Improved the readability of strspn with minor optimization =20 Signed-off-by: Xiao Zeng 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 =3D s2; *c; c++) { if (*s1 =3D=3D *c) - break; + goto found; } if (*c =3D=3D '\0') break; +found: s1++; }