line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Moose::Meta::Method::Accessor::Native::Array::splice; |
2
|
|
|
|
|
|
|
our $VERSION = '2.2206'; |
3
|
|
|
|
|
|
|
|
4
|
4
|
|
|
4
|
|
2734
|
use strict; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
142
|
|
5
|
4
|
|
|
4
|
|
25
|
use warnings; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
146
|
|
6
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
25
|
use Moose::Role; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
31
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
with 'Moose::Meta::Method::Accessor::Native::Array::Writer'; |
10
|
|
|
|
|
|
|
|
11
|
35
|
|
|
35
|
|
120
|
sub _minimum_arguments { 1 } |
12
|
|
|
|
|
|
|
|
13
|
17
|
|
|
17
|
|
58
|
sub _adds_members { 1 } |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub _inline_process_arguments { |
16
|
|
|
|
|
|
|
return ( |
17
|
35
|
|
|
35
|
|
131
|
'my $idx = shift;', |
18
|
|
|
|
|
|
|
'my $len = @_ ? shift : undef;', |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _inline_check_arguments { |
23
|
35
|
|
|
35
|
|
71
|
my $self = shift; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
return ( |
26
|
35
|
|
|
|
|
137
|
$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
|
|
90
|
my $self = shift; |
41
|
35
|
|
|
|
|
79
|
my ($slot_access) = @_; |
42
|
|
|
|
|
|
|
|
43
|
35
|
|
|
|
|
156
|
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
|
|
59
|
my $self = shift; |
54
|
23
|
|
|
|
|
77
|
my ($inv, $new, $slot_access) = @_; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
return ( |
57
|
23
|
|
|
|
|
154
|
'@return = defined $len', |
58
|
|
|
|
|
|
|
'? (splice @{ (' . $slot_access . ') }, $idx, $len, @_)', |
59
|
|
|
|
|
|
|
': (splice @{ (' . $slot_access . ') }, $idx);', |
60
|
|
|
|
|
|
|
); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub _return_value { |
64
|
70
|
|
|
70
|
|
149
|
my $self = shift; |
65
|
70
|
|
|
|
|
165
|
my ($slot_access) = @_; |
66
|
|
|
|
|
|
|
|
67
|
70
|
|
|
|
|
292
|
return 'wantarray ? @return : $return[-1]'; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
4
|
|
|
4
|
|
48
|
no Moose::Role; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
25
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |