1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

Optimize [Cc]flag case: don't repeatedly add the last character of

string2 to squeeze cset when string2 reach its EOS state.
This commit is contained in:
Andrey A. Chernov 2016-07-14 09:26:53 +00:00
parent 4573d5012b
commit c4c8ae8b87
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=302827

View File

@ -272,10 +272,11 @@ main(int argc, char **argv)
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) &&