summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2012-02-28 23:54:10 +0100
committerNicholas Clark <nick@ccl4.org>2012-02-29 00:11:37 +0100
commitc82d70d7106ab5f3f9edac8b96ab40ddbc6a082f (patch)
tree4690c7cbbb9156a11f567e101518ea7d723b7bd9
parent9a66f664966e1fe68fa8334413ccaf4858344c1b (diff)
downloadperl-nicholas/feature-code-shrink.tar.gz
In feature.pm, inline current_bundle() into __common(), its only caller.nicholas/feature-code-shrink
current_bundle() was added after 5.14.0 was released, so has never been in a stable release. Hence it's totally safe to kill it.
-rw-r--r--lib/feature.pm11
-rwxr-xr-xregen/feature.pl11
2 files changed, 8 insertions, 14 deletions
diff --git a/lib/feature.pm b/lib/feature.pm
index 3f29d781b8..87b42aa916 100644
--- a/lib/feature.pm
+++ b/lib/feature.pm
@@ -299,12 +299,6 @@ bundle is automatically loaded instead.
=cut
-sub current_bundle {
- my $bundle_number = $^H & $hint_mask;
- return if $bundle_number == $hint_mask;
- return $feature_bundle{$hint_bundles[$bundle_number >> $hint_shift]};
-}
-
sub import {
my $class = shift;
@@ -330,7 +324,10 @@ sub unimport {
sub __common {
my $import = shift;
- if (my $features = current_bundle) {
+ my $bundle_number = $^H & $hint_mask;
+ my $features = $bundle_number != $hint_mask
+ && $feature_bundle{$hint_bundles[$bundle_number >> $hint_shift]};
+ if ($features) {
# Features are enabled implicitly via bundle hints.
# Delete any keys that may be left over from last time.
delete @^H{ values(%feature) };
diff --git a/regen/feature.pl b/regen/feature.pl
index 7f59847a9d..2a8d369ba2 100755
--- a/regen/feature.pl
+++ b/regen/feature.pl
@@ -583,12 +583,6 @@ bundle is automatically loaded instead.
=cut
-sub current_bundle {
- my $bundle_number = $^H & $hint_mask;
- return if $bundle_number == $hint_mask;
- return $feature_bundle{$hint_bundles[$bundle_number >> $hint_shift]};
-}
-
sub import {
my $class = shift;
@@ -614,7 +608,10 @@ sub unimport {
sub __common {
my $import = shift;
- if (my $features = current_bundle) {
+ my $bundle_number = $^H & $hint_mask;
+ my $features = $bundle_number != $hint_mask
+ && $feature_bundle{$hint_bundles[$bundle_number >> $hint_shift]};
+ if ($features) {
# Features are enabled implicitly via bundle hints.
# Delete any keys that may be left over from last time.
delete @^H{ values(%feature) };