line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Moose::Meta::Method::Accessor::Native::Array::splice; |
2
|
|
|
|
|
|
|
our $VERSION = '2.2203'; |
3
|
|
|
|
|
|
|
|
4
|
4
|
|
|
4
|
|
2441
|
use strict; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
122
|
|
5
|
4
|
|
|
4
|
|
21
|
use warnings; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
103
|
|
6
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
18
|
use Moose::Role; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
30
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
with 'Moose::Meta::Method::Accessor::Native::Array::Writer'; |
10
|
|
|
|
|
|
|
|
11
|
35
|
|
|
35
|
|
98
|
sub _minimum_arguments { 1 } |
12
|
|
|
|
|
|
|
|
13
|
17
|
|
|
17
|
|
51
|
sub _adds_members { 1 } |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub _inline_process_arguments { |
16
|
|
|
|
|
|
|
return ( |
17
|
35
|
|
|
35
|
|
109
|
'my $idx = shift;', |
18
|
|
|
|
|
|
|
'my $len = @_ ? shift : undef;', |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _inline_check_arguments { |
23
|
35
|
|
|
35
|
|
68
|
my $self = shift; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
return ( |
26
|
35
|
|
|
|
|
114
|
$self->_inline_check_var_is_valid_index('$idx'), |
27
|
|
|
|
|
|
|
'if (defined($len) && $len !~ /^-?\d+$/) {', |
28
|
|
|
|
|
|
|
$self->_inline_throw_exception( InvalidArgumentToMethod => |
29
|
|
|
|
|
|
|
'argument => $len,'. |
30
|
|
|
|
|
|
|
'method_name => "splice",'. |
31
|
|
|
|
|
|
|
'type_of_argument => "integer",'. |
32
|
|
|
|
|
|
|
'type => "Int",'. |
33
|
|
|
|
|
|
|
'argument_noun => "length argument"', |
34
|
|
|
|
|
|
|
) . ';', |
35
|
|
|
|
|
|
|
'}', |
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub _potential_value { |
40
|
35
|
|
|
35
|
|
71
|
my $self = shift; |
41
|
35
|
|
|
|
|
69
|
my ($slot_access) = @_; |
42
|
|
|
|
|
|
|
|
43
|
35
|
|
|
|
|
147
|
return '(do { ' |
44
|
|
|
|
|
|
|
. 'my @potential = @{ (' . $slot_access . ') }; ' |
45
|
|
|
|
|
|
|
. '@return = defined $len ' |
46
|
|
|
|
|
|
|
. '? (splice @potential, $idx, $len, @_) ' |
47
|
|
|
|
|
|
|
. ': (splice @potential, $idx); ' |
48
|
|
|
|
|
|
|
. '\@potential;' |
49
|
|
|
|
|
|
|
. '})'; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub _inline_optimized_set_new_value { |
53
|
23
|
|
|
23
|
|
54
|
my $self = shift; |
54
|
23
|
|
|
|
|
67
|
my ($inv, $new, $slot_access) = @_; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
return ( |
57
|
23
|
|
|
|
|
119
|
'@return = defined $len', |
58
|
|
|
|
|
|
|
'? (splice @{ (' . $slot_access . ') }, $idx, $len, @_)', |
59
|
|
|
|
|
|
|
': (splice @{ (' . $slot_access . ') }, $idx);', |
60
|
|
|
|
|
|
|
); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub _return_value { |
64
|
70
|
|
|
70
|
|
113
|
my $self = shift; |
65
|
70
|
|
|
|
|
144
|
my ($slot_access) = @_; |
66
|
|
|
|
|
|
|
|
67
|
70
|
|
|
|
|
238
|
return 'wantarray ? @return : $return[-1]'; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
4
|
|
|
4
|
|
31
|
no Moose::Role; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
27
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |