line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Moose::Meta::Method::Accessor::Native::Array::splice; |
2
|
|
|
|
|
|
|
our $VERSION = '2.2205'; |
3
|
|
|
|
|
|
|
|
4
|
4
|
|
|
4
|
|
2859
|
use strict; |
|
4
|
|
|
|
|
14
|
|
|
4
|
|
|
|
|
140
|
|
5
|
4
|
|
|
4
|
|
23
|
use warnings; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
141
|
|
6
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
25
|
use Moose::Role; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
33
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
with 'Moose::Meta::Method::Accessor::Native::Array::Writer'; |
10
|
|
|
|
|
|
|
|
11
|
35
|
|
|
35
|
|
126
|
sub _minimum_arguments { 1 } |
12
|
|
|
|
|
|
|
|
13
|
17
|
|
|
17
|
|
50
|
sub _adds_members { 1 } |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub _inline_process_arguments { |
16
|
|
|
|
|
|
|
return ( |
17
|
35
|
|
|
35
|
|
118
|
'my $idx = shift;', |
18
|
|
|
|
|
|
|
'my $len = @_ ? shift : undef;', |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _inline_check_arguments { |
23
|
35
|
|
|
35
|
|
78
|
my $self = shift; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
return ( |
26
|
35
|
|
|
|
|
152
|
$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
|
|
78
|
my $self = shift; |
41
|
35
|
|
|
|
|
72
|
my ($slot_access) = @_; |
42
|
|
|
|
|
|
|
|
43
|
35
|
|
|
|
|
161
|
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
|
|
66
|
my $self = shift; |
54
|
23
|
|
|
|
|
65
|
my ($inv, $new, $slot_access) = @_; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
return ( |
57
|
23
|
|
|
|
|
140
|
'@return = defined $len', |
58
|
|
|
|
|
|
|
'? (splice @{ (' . $slot_access . ') }, $idx, $len, @_)', |
59
|
|
|
|
|
|
|
': (splice @{ (' . $slot_access . ') }, $idx);', |
60
|
|
|
|
|
|
|
); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub _return_value { |
64
|
70
|
|
|
70
|
|
135
|
my $self = shift; |
65
|
70
|
|
|
|
|
158
|
my ($slot_access) = @_; |
66
|
|
|
|
|
|
|
|
67
|
70
|
|
|
|
|
270
|
return 'wantarray ? @return : $return[-1]'; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
4
|
|
|
4
|
|
41
|
no Moose::Role; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
28
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |