This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
toke.c: Keep better track for avoiding work in tr///
authorKarl Williamson <khw@cpan.org>
Wed, 28 Dec 2016 04:15:43 +0000 (21:15 -0700)
committerKarl Williamson <khw@cpan.org>
Tue, 3 Jan 2017 04:46:42 +0000 (21:46 -0700)
commit188d22cf717ab070718f1459212a881ded22bef4
tree08d02479c93797b3bc66ee871714c86b85f54b92
parentec282617d074afafad84a1049786659375a2d285
toke.c: Keep better track for avoiding work in tr///

As explained in the comments, tr/// creates byte map tables for bytes
0-255 if everything is below 256.  If something is higher than that,
special handling is required (currently a swash), and so there is no
point in creating the tables here by expanding each range.  Prior to
this commit, it realized this on a per-range basis, not expanding ranges
which extend above 255.  This commit changes that so if any time it
finds something above 255, it remembers that and skips the expansion of
all future ranges encountered.

This was done without adding any extra tests outside the specific tr///
code.
toke.c