summaryrefslogtreecommitdiff
path: root/regen
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2014-07-19 15:27:37 -0600
committerKarl Williamson <khw@cpan.org>2015-01-21 22:47:29 -0700
commitceb1de328867596fe25e6af64b5e1c83f0777448 (patch)
treec12fa96bee9b4c9d420f32d65f722d3d8c092e4b /regen
parent1c8c342800b7a2711d2a5dd499c4a58af8547b93 (diff)
downloadperl-ceb1de328867596fe25e6af64b5e1c83f0777448.tar.gz
regen/mk_invlists.pl: Skip unnecessary work
This reorders the code points below 256 depending on the platform. However all platforms have the same values for those above 255, so can skip this code if the first code point (and hence all code points) being output isn't one of those affected.
Diffstat (limited to 'regen')
-rw-r--r--regen/mk_invlists.pl9
1 files changed, 9 insertions, 0 deletions
diff --git a/regen/mk_invlists.pl b/regen/mk_invlists.pl
index 5d15690a1c..4902f6e1c5 100644
--- a/regen/mk_invlists.pl
+++ b/regen/mk_invlists.pl
@@ -230,6 +230,14 @@ for my $charset (get_supported_code_pages()) {
@invlist = prop_invlist($lookup_prop, '_perl_core_internal_ok');
}
die "Could not find inversion list for '$lookup_prop'" unless @invlist;
+
+ # Re-order the Unicode code points to native ones for this platform;
+ # only needed for code points below 256, and only if the first range
+ # doesn't span the whole of 0..256 (256 not 255 because a re-ordering
+ # could cause 256 to need to be in the same range as 255.)
+ if (! $nonl1_only || ($invlist[0] < 256
+ && ! ($invlist[0] == 0 && $invlist[1] > 256)))
+ {
my @full_list;
for (my $i = 0; $i < @invlist; $i += 2) {
my $upper = ($i + 1) < @invlist
@@ -250,6 +258,7 @@ for my $charset (get_supported_code_pages()) {
}
@full_list = sort { $a <=> $b } @full_list;
@invlist = mk_invlist_from_cp_list(\@full_list);
+ }
if ($l1_only) {
for my $i (0 .. @invlist - 1 - 1) {