Date: Wed, 17 Aug 2016 09:12:02 +0000 (UTC) From: "Andrey A. Chernov" <ache@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304278 - stable/11/usr.bin/tr Message-ID: <201608170912.u7H9C2Vu049346@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ache Date: Wed Aug 17 09:12:02 2016 New Revision: 304278 URL: https://svnweb.freebsd.org/changeset/base/304278 Log: MFC r302827 Optimize [Cc]flag case: don't repeatedly add the last character of string2 to squeeze cset when string2 reach its EOS state. Modified: stable/11/usr.bin/tr/tr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/tr/tr.c ============================================================================== --- stable/11/usr.bin/tr/tr.c Wed Aug 17 09:10:22 2016 (r304277) +++ stable/11/usr.bin/tr/tr.c Wed Aug 17 09:12:02 2016 (r304278) @@ -272,10 +272,11 @@ endloop: if (Cflag && !iswrune(cnt)) continue; if (cmap_lookup(map, cnt) == OOBCH) { - if (next(&s2)) + if (next(&s2)) { cmap_add(map, cnt, s2.lastch); - if (sflag) - cset_add(squeeze, s2.lastch); + if (sflag) + cset_add(squeeze, s2.lastch); + } } else cmap_add(map, cnt, cnt); if ((s2.state == EOS || s2.state == INFINITE) &&
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608170912.u7H9C2Vu049346>