- or download this
my $idx = 0;
for my $j (@a) {
...
}
++$idx;
}
- or download this
my $idx = firstidx { $_ == $target } @a;
splice(@a, $idx, 1) if $idx >= 0;
- or download this
Rate for firstidx
for 24.3/s -- -22%
firstidx 31.1/s 28% --
- or download this
#!/usr/bin/env perl
...
# Sanity check: arrays are the same
die "Array length mismatch" if @for != @firstidx;
die "Content different" if grep { $for[$_] != $firstidx[$_] } 0..$#for
+;