diff options
author | Ævar Arnfjörð Bjarmason <avar@cpan.org> | 2007-05-18 20:16:53 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-05-20 12:48:01 +0000 |
commit | 7be54ea7d51824e3590034a7880ff325459e8d52 (patch) | |
tree | 71916472478c786782cda47e926e5bdcf4d29452 | |
parent | ff6757447f8d7d8be9f1cef7f35b9de657c4763e (diff) | |
download | perl-7be54ea7d51824e3590034a7880ff325459e8d52.tar.gz |
Don't use a regex match in lib/feature.pm
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Message-ID: <51dd1af80705181316r15f65e45n55903de294565aa1@mail.gmail.com>
p4raw-id: //depot/perl@31241
-rw-r--r-- | lib/feature.pm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/feature.pm b/lib/feature.pm index 7a88b154c8..f33ce2d42b 100644 --- a/lib/feature.pm +++ b/lib/feature.pm @@ -151,11 +151,11 @@ sub import { } while (@_) { my $name = shift(@_); - if ($name =~ /^:(.*)/) { - if (!exists $feature_bundle{$1}) { - unknown_feature_bundle($1); + if (substr($name, 0, 1) eq ":" and (my $v = substr($name, 1))) { + if (!exists $feature_bundle{$v}) { + unknown_feature_bundle($v); } - unshift @_, @{$feature_bundle{$1}}; + unshift @_, @{$feature_bundle{$v}}; next; } if (!exists $feature{$name}) { @@ -176,11 +176,11 @@ sub unimport { while (@_) { my $name = shift; - if ($name =~ /^:(.*)/) { - if (!exists $feature_bundle{$1}) { - unknown_feature_bundle($1); + if (substr($name, 0, 1) eq ":" and (my $v = substr($name, 1))) { + if (!exists $feature_bundle{$v}) { + unknown_feature_bundle($v); } - unshift @_, @{$feature_bundle{$1}}; + unshift @_, @{$feature_bundle{$v}}; next; } if (!exists($feature{$name})) { |