line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bootylicious::IteratorSearchable; |
2
|
|
|
|
|
|
|
|
3
|
15
|
|
|
15
|
|
611
|
use strict; |
|
15
|
|
|
|
|
16
|
|
|
15
|
|
|
|
|
311
|
|
4
|
15
|
|
|
15
|
|
42
|
use warnings; |
|
15
|
|
|
|
|
14
|
|
|
15
|
|
|
|
|
281
|
|
5
|
|
|
|
|
|
|
|
6
|
15
|
|
|
15
|
|
42
|
use base 'Bootylicious::Decorator'; |
|
15
|
|
|
|
|
17
|
|
|
15
|
|
|
|
|
4455
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub find_first { |
9
|
24
|
|
|
24
|
0
|
42
|
my $self = shift; |
10
|
24
|
|
|
|
|
23
|
my $cb = shift; |
11
|
|
|
|
|
|
|
|
12
|
24
|
|
|
|
|
125
|
$self->rewind; |
13
|
|
|
|
|
|
|
|
14
|
24
|
|
|
|
|
99
|
while (my $el = $self->next) { |
15
|
27
|
100
|
|
|
|
47
|
if (my $res = $cb->($self->object, $el)) { |
16
|
15
|
|
|
|
|
80
|
return $res; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
9
|
|
|
|
|
57
|
return; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub find_all { |
24
|
11
|
|
|
11
|
0
|
21
|
my $self = shift; |
25
|
11
|
|
|
|
|
10
|
my $cb = shift; |
26
|
|
|
|
|
|
|
|
27
|
11
|
|
|
|
|
61
|
$self->rewind; |
28
|
|
|
|
|
|
|
|
29
|
11
|
|
|
|
|
11
|
my @found_elements; |
30
|
11
|
|
|
|
|
47
|
while (my $el = $self->next) { |
31
|
22
|
100
|
|
|
|
39
|
if (my $res = $cb->($self->object, $el)) { |
32
|
10
|
|
|
|
|
57
|
push @found_elements, $res; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
11
|
|
|
|
|
51
|
return Bootylicious::Iterator->new(elements => [@found_elements]); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |