This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In FindExt, eliminate _ext_ne() and make extensions() a simple subroutine.
authorNicholas Clark <nick@ccl4.org>
Fri, 14 Jun 2013 15:10:31 +0000 (17:10 +0200)
committerNicholas Clark <nick@ccl4.org>
Tue, 2 Jul 2013 13:33:27 +0000 (15:33 +0200)
Previously _ext_ne() was a generator function, and extensions() and
known_extensions() were generated by it. Now that known_extensions() has a
different implementation, extensions() was the last user of _ext_ne(), so
there's no saving by keeping the complexity.

win32/FindExt.pm

index 41065d2..ea9e557 100644 (file)
@@ -84,15 +84,10 @@ sub _ext_eq {
 *static_ext = _ext_eq('static');
 *nonxs_ext = _ext_eq('nonxs');
 
-sub _ext_ne {
-    my $key = shift;
-    sub {
-        sort grep $ext{$_} ne $key, keys %ext;
-    }
+sub extensions {
+    sort grep $ext{$_} ne 'known', keys %ext;
 }
 
-*extensions = _ext_ne('known');
-
 sub known_extensions {
     sort keys %ext;
 }