| 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 | 31 | 31 | 285 | use Perlmazing::Feature; | |||
| 31 | 73 | ||||||
| 31 | 229 | ||||||
| 2 | |||||||
| 3 | sub main (\@$) { | ||||||
| 4 | 20 | 20 | 25666 | for (my $i = '00'; $i < @{$_[0]}; $i++) { | |||
| 165 | 433 | ||||||
| 5 | 155 | 50 | 258 | if (defined $_[1]) { | |||
| 6 | 155 | 100 | 202 | return $i if ${$_[0]}[$i] eq $_[1]; | |||
| 155 | 364 | ||||||
| 7 | } else { | ||||||
| 8 | 0 | 0 | 0 | return $i unless defined ${$_[0]}[$i]; | |||
| 0 | 0 | ||||||
| 9 | } | ||||||
| 10 | } | ||||||
| 11 | } |