line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Diff3::ListMixin; |
2
|
6
|
|
|
6
|
|
4092
|
use 5.006; |
|
6
|
|
|
|
|
19
|
|
|
6
|
|
|
|
|
231
|
|
3
|
6
|
|
|
6
|
|
29
|
use strict; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
169
|
|
4
|
6
|
|
|
6
|
|
27
|
use warnings; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
152
|
|
5
|
6
|
|
|
6
|
|
29
|
use Carp; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
576
|
|
6
|
|
|
|
|
|
|
|
7
|
6
|
|
|
6
|
|
31
|
use version; our $VERSION = '0.08'; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
37
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
## no critic (BuiltinHomonyms AmbiguousNames) |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub at { |
12
|
0
|
|
|
0
|
1
|
0
|
my($self, $x) = @_; |
13
|
0
|
|
|
|
|
0
|
return $self->list->[$x]; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub push { |
17
|
90
|
|
|
90
|
1
|
8344
|
my($self, @arg) = @_; |
18
|
90
|
|
|
|
|
198
|
return CORE::push @{$self->list}, @arg; |
|
90
|
|
|
|
|
259
|
|
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub pop { |
22
|
0
|
|
|
0
|
1
|
0
|
my($self) = @_; |
23
|
0
|
|
|
|
|
0
|
return CORE::pop @{$self->list}; |
|
0
|
|
|
|
|
0
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub unshift { |
27
|
0
|
|
|
0
|
1
|
0
|
my($self, @arg) = @_; |
28
|
0
|
|
|
|
|
0
|
return CORE::unshift @{$self->list}, @arg; |
|
0
|
|
|
|
|
0
|
|
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub shift { |
32
|
49
|
|
|
49
|
1
|
68
|
my($self) = @_; |
33
|
49
|
|
|
|
|
41
|
return CORE::shift @{$self->list}; |
|
49
|
|
|
|
|
99
|
|
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub is_empty { |
37
|
188
|
|
|
188
|
1
|
202
|
my($self) = @_; |
38
|
188
|
|
|
|
|
174
|
return ! (scalar @{$self->list}); |
|
188
|
|
|
|
|
400
|
|
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub size { |
42
|
4
|
|
|
4
|
1
|
469
|
my($self) = @_; |
43
|
4
|
|
|
|
|
8
|
return scalar @{$self->list}; |
|
4
|
|
|
|
|
15
|
|
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub first { |
47
|
102
|
|
|
102
|
1
|
116
|
my($self) = @_; |
48
|
102
|
|
|
|
|
224
|
return $self->list->[0]; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub last { |
52
|
1
|
|
|
1
|
1
|
9
|
my($self) = @_; |
53
|
1
|
|
|
|
|
18
|
return $self->list->[-1]; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub each { |
57
|
0
|
|
|
0
|
1
|
|
my($self, $yield) = @_; |
58
|
0
|
0
|
|
|
|
|
ref $yield eq 'CODE' or croak 'requires coderef'; |
59
|
0
|
|
|
|
|
|
for (@{$self->list}) { |
|
0
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
$yield->($_); |
61
|
|
|
|
|
|
|
} |
62
|
0
|
|
|
|
|
|
return $self; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
__END__ |