line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Moose::Meta::Method::Accessor::Native::Array::insert; |
2
|
|
|
|
|
|
|
our $VERSION = '2.2205'; |
3
|
|
|
|
|
|
|
|
4
|
4
|
|
|
4
|
|
3177
|
use strict; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
140
|
|
5
|
4
|
|
|
4
|
|
31
|
use warnings; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
154
|
|
6
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
22
|
use Moose::Role; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
36
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
with 'Moose::Meta::Method::Accessor::Native::Array::Writer'; |
10
|
|
|
|
|
|
|
|
11
|
20
|
|
|
20
|
|
68
|
sub _minimum_arguments { 2 } |
12
|
|
|
|
|
|
|
|
13
|
20
|
|
|
20
|
|
68
|
sub _maximum_arguments { 2 } |
14
|
|
|
|
|
|
|
|
15
|
9
|
|
|
9
|
|
31
|
sub _adds_members { 1 } |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub _potential_value { |
18
|
20
|
|
|
20
|
|
52
|
my $self = shift; |
19
|
20
|
|
|
|
|
57
|
my ($slot_access) = @_; |
20
|
|
|
|
|
|
|
|
21
|
20
|
|
|
|
|
93
|
return '(do { ' |
22
|
|
|
|
|
|
|
. 'my @potential = @{ (' . $slot_access . ') }; ' |
23
|
|
|
|
|
|
|
. 'splice @potential, $_[0], 0, $_[1]; ' |
24
|
|
|
|
|
|
|
. '\@potential; ' |
25
|
|
|
|
|
|
|
. '})'; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# We need to override this because while @_ can be written to, we cannot write |
29
|
|
|
|
|
|
|
# directly to $_[1]. |
30
|
|
|
|
|
|
|
sub _inline_coerce_new_values { |
31
|
20
|
|
|
20
|
|
46
|
my $self = shift; |
32
|
|
|
|
|
|
|
|
33
|
20
|
100
|
|
|
|
68
|
return unless $self->associated_attribute->should_coerce; |
34
|
|
|
|
|
|
|
|
35
|
4
|
100
|
|
|
|
26
|
return unless $self->_tc_member_type_can_coerce; |
36
|
|
|
|
|
|
|
|
37
|
1
|
|
|
|
|
8
|
return '@_ = ($_[0], $member_coercion->($_[1]));'; |
38
|
|
|
|
|
|
|
}; |
39
|
|
|
|
|
|
|
|
40
|
9
|
|
|
9
|
|
32
|
sub _new_members { '$_[1]' } |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub _inline_optimized_set_new_value { |
43
|
12
|
|
|
12
|
|
34
|
my $self = shift; |
44
|
12
|
|
|
|
|
36
|
my ($inv, $new, $slot_access) = @_; |
45
|
|
|
|
|
|
|
|
46
|
12
|
|
|
|
|
66
|
return 'splice @{ (' . $slot_access . ') }, $_[0], 0, $_[1];'; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub _return_value { |
50
|
40
|
|
|
40
|
|
79
|
my $self = shift; |
51
|
40
|
|
|
|
|
98
|
my ($slot_access) = @_; |
52
|
|
|
|
|
|
|
|
53
|
40
|
|
|
|
|
178
|
return $slot_access . '->[ $_[0] ]'; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
4
|
|
|
4
|
|
35
|
no Moose::Role; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
32
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |