This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In feature.pm, inline current_bundle() into __common(), its only caller.
authorNicholas Clark <nick@ccl4.org>
Tue, 28 Feb 2012 22:54:10 +0000 (23:54 +0100)
committerNicholas Clark <nick@ccl4.org>
Mon, 19 Mar 2012 09:21:54 +0000 (10:21 +0100)
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.

lib/feature.pm
regen/feature.pl

index 3f29d78..87b42aa 100644 (file)
@@ -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) };
index 7f59847..2a8d369 100755 (executable)
@@ -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) };