diff options
author | Karl Williamson <khw@cpan.org> | 2017-01-18 15:36:49 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2017-01-19 14:42:08 -0700 |
commit | aca416674931e15d761081a4bf7403619de2f0de (patch) | |
tree | f99a7ab588f2f3353d6802ff11f562e4c29a884e /toke.c | |
parent | 8efef67cc8e7c6d4bbc57cd7a7067d1e25248eea (diff) | |
download | perl-aca416674931e15d761081a4bf7403619de2f0de.tar.gz |
toke.c: Avoid work if tr/a-b/foo/
A two-element range here is already fully set up, and no need to do
anything.
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -3092,6 +3092,14 @@ S_scan_const(pTHX_ char *start) } } + /* If the range is exactly two code points long, they are + * already both in the output */ + if (UNLIKELY(range_min + 1 == range_max)) { + goto range_done; + } + + /* Here the range contains at least 3 code points */ + if (has_utf8) { /* If everything in the transliteration is below 256, we |