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