lib/Perlmazing/Perlmazing/Precompile/in_array.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 8 | 10 | 80.0 |
branch | 3 | 6 | 50.0 |
condition | n/a | ||
subroutine | 2 | 2 | 100.0 |
pod | n/a | ||
total | 13 | 18 | 72.2 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | 32 | 32 | 300 | use Perlmazing::Feature; | |||
32 | 89 | ||||||
32 | 195 | ||||||
2 | |||||||
3 | sub main (\@$) { | ||||||
4 | 20 | 20 | 24664 | for (my $i = '00'; $i < @{$_[0]}; $i++) { | |||
165 | 435 | ||||||
5 | 155 | 50 | 257 | if (defined $_[1]) { | |||
6 | 155 | 100 | 201 | return $i if ${$_[0]}[$i] eq $_[1]; | |||
155 | 361 | ||||||
7 | } else { | ||||||
8 | 0 | 0 | 0 | return $i unless defined ${$_[0]}[$i]; | |||
0 | 0 | ||||||
9 | } | ||||||
10 | } | ||||||
11 | } |