| 1 | package Text::Diff3::ListMixin; | ||||||||||
| 2 | 6 | ▶ | use 5.006; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 6 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 6 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 6 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 6 | ▶ | use version; our $VERSION = '0.08'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | ## no critic (BuiltinHomonyms AmbiguousNames) | ||||||||||
| 10 | |||||||||||
| 11 | 0 | ▶ | sub at { | ||||||||
|
Subroutine
at: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 12 | 0 | my($self, $x) = @_; | |||||||||
| 13 | 0 | return $self->list->[$x]; | |||||||||
| 14 | } | ||||||||||
| 15 | |||||||||||
| 16 | 90 | ▶ | sub push { | ||||||||
|
Subroutine
push: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 17 | 90 | my($self, @arg) = @_; | |||||||||
| 18 | 90 | return CORE::push @{$self->list}, @arg; | |||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 0 | ▶ | sub pop { | ||||||||
|
Subroutine
pop: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 22 | 0 | my($self) = @_; | |||||||||
| 23 | 0 | return CORE::pop @{$self->list}; | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | 0 | ▶ | sub unshift { | ||||||||
|
Subroutine
unshift: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 27 | 0 | my($self, @arg) = @_; | |||||||||
| 28 | 0 | return CORE::unshift @{$self->list}, @arg; | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 49 | ▶ | sub shift { | ||||||||
|
Subroutine
shift: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 32 | 49 | my($self) = @_; | |||||||||
| 33 | 49 | return CORE::shift @{$self->list}; | |||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 188 | ▶ | sub is_empty { | ||||||||
|
Subroutine
is_empty: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 37 | 188 | my($self) = @_; | |||||||||
| 38 | 188 | return ! (scalar @{$self->list}); | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | 4 | ▶ | sub size { | ||||||||
|
Subroutine
size: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 42 | 4 | my($self) = @_; | |||||||||
| 43 | 4 | return scalar @{$self->list}; | |||||||||
| 44 | } | ||||||||||
| 45 | |||||||||||
| 46 | 102 | ▶ | sub first { | ||||||||
|
Subroutine
first: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 47 | 102 | my($self) = @_; | |||||||||
| 48 | 102 | return $self->list->[0]; | |||||||||
| 49 | } | ||||||||||
| 50 | |||||||||||
| 51 | 1 | ▶ | sub last { | ||||||||
|
Subroutine
last: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 52 | 1 | my($self) = @_; | |||||||||
| 53 | 1 | return $self->list->[-1]; | |||||||||
| 54 | } | ||||||||||
| 55 | |||||||||||
| 56 | 0 | ▶ | sub each { | ||||||||
|
Subroutine
each: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 57 | 0 | my($self, $yield) = @_; | |||||||||
| 58 | 0 | ▶ | ref $yield eq 'CODE' or croak 'requires coderef'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 59 | 0 | for (@{$self->list}) { | |||||||||
| 60 | 0 | $yield->($_); | |||||||||
| 61 | } | ||||||||||
| 62 | 0 | return $self; | |||||||||
| 63 | } | ||||||||||
| 64 | |||||||||||
| 65 | 6 | 1; | |||||||||
| 66 | |||||||||||
| 67 | __END__ | ||||||||||