From: Father Chrysostomos Date: Tue, 15 Nov 2011 12:58:50 +0000 (-0800) Subject: feature.pm: Avoid repetition; save memory X-Git-Tag: v5.15.5~84 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/0d2bd2aac5a8ee613a8fdf0b0a601c608f500286?hp=167f59c18c1e17cd1060b030cf95ff2deb1d4833 feature.pm: Avoid repetition; save memory --- diff --git a/lib/feature.pm b/lib/feature.pm index 6ab650d..ce73e2d 100644 --- a/lib/feature.pm +++ b/lib/feature.pm @@ -19,18 +19,18 @@ our $hint_uni8bit = 0x00000800; # NB. the latest bundle must be loaded by the -E switch (see toke.c) -my %feature_bundle = ( +our %feature_bundle = ( "5.10" => [qw(say state switch)], "5.11" => [qw(say state switch unicode_strings)], - "5.12" => [qw(say state switch unicode_strings)], - "5.13" => [qw(say state switch unicode_strings)], - "5.14" => [qw(say state switch unicode_strings)], "5.15" => [qw(say state switch unicode_strings unicode_eval evalbytes)], - "5.16" => [qw(say state switch unicode_strings unicode_eval - evalbytes)], ); +# Each of these is the same as the previous bundle +for(12...14, 16) { + $feature_bundle{"5.$_"} = $feature_bundle{"5.".($_-1)} +} + # special case $feature_bundle{"5.9.5"} = $feature_bundle{"5.10"};