summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGraham Knop <haarg@haarg.org>2014-03-23 12:10:04 -0400
committerGraham Knop <haarg@haarg.org>2014-03-23 12:10:04 -0400
commitffccea292395f8c60abdfe4a8b3a268f1f0b7a31 (patch)
treec2c1d1f0162ec6782d0b30107e578f15bac5a226
parenta2034e6d456863378a06e936f07dd24ef45f70df (diff)
downloaddist-checkconflicts-ffccea292395f8c60abdfe4a8b3a268f1f0b7a31.tar.gz
dist-checkconflicts-ffccea292395f8c60abdfe4a8b3a268f1f0b7a31.zip
stop using List::MoreUtils::first_index
-rw-r--r--lib/Dist/CheckConflicts.pm14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Dist/CheckConflicts.pm b/lib/Dist/CheckConflicts.pm
index 9cf8729..9f9b4cd 100644
--- a/lib/Dist/CheckConflicts.pm
+++ b/lib/Dist/CheckConflicts.pm
@@ -10,7 +10,6 @@ our @EXPORT = our @EXPORT_OK = (
);
use Carp;
-use List::MoreUtils 0.12 'first_index';
use Module::Runtime 0.009 'module_notional_filename', 'require_module';
=head1 SYNOPSIS
@@ -174,13 +173,14 @@ sub import {
sub _strip_opt {
my ($opt, @args) = @_;
- my $idx = first_index { ( $_ || '' ) eq $opt } @args;
- return ( undef, @args ) unless $idx >= 0 && $#args >= $idx + 1;
-
- my $val = $args[ $idx + 1 ];
-
- splice @args, $idx, 2;
+ my $val;
+ for my $idx ( 0 .. $#args - 1 ) {
+ if (defined $args[$idx] && $args[$idx] eq $opt) {
+ $val = (splice @args, $idx, 2)[1];
+ last;
+ }
+ }
return ( $val, @args );
}