line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MsgPack::Decoder::Generator::Array; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:YANICK'; |
3
|
|
|
|
|
|
|
$MsgPack::Decoder::Generator::Array::VERSION = '2.0.3'; |
4
|
3
|
|
|
3
|
|
1652
|
use Moose; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
24
|
|
5
|
3
|
|
|
3
|
|
20268
|
use MooseX::MungeHas 'is_ro'; |
|
3
|
|
|
|
|
12
|
|
|
3
|
|
|
|
|
30
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
extends 'MsgPack::Decoder::Generator'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has size => ( required => 1,); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has values => ( |
12
|
|
|
|
|
|
|
isa => 'ArrayRef', |
13
|
|
|
|
|
|
|
lazy => 1, |
14
|
|
|
|
|
|
|
default => sub { [] }, |
15
|
|
|
|
|
|
|
traits => [ 'Array' ], |
16
|
|
|
|
|
|
|
handles => { |
17
|
|
|
|
|
|
|
push_value => 'push', |
18
|
|
|
|
|
|
|
nbr_values => 'count', |
19
|
|
|
|
|
|
|
}, |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
23
|
|
|
23
|
|
870
|
has '+bytes' => sub { 0 }; |
23
|
|
|
|
|
|
|
|
24
|
19
|
|
|
19
|
|
691
|
has is_map => sub { 0 }; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
has '+next' => sub { |
27
|
23
|
|
|
23
|
|
423
|
my $self = shift; |
28
|
|
|
|
|
|
|
|
29
|
23
|
|
|
|
|
582
|
my $size= $self->size; |
30
|
23
|
100
|
|
|
|
709
|
$size *= 2 if $self->is_map; |
31
|
|
|
|
|
|
|
|
32
|
23
|
50
|
|
|
|
227
|
unless( $size ) { |
33
|
0
|
0
|
|
|
|
0
|
$self->push_decoded->( $self->is_map ? {} : [] ); |
34
|
0
|
|
|
|
|
0
|
return []; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
23
|
|
|
|
|
49
|
my @array; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
my @next = ( ( ['Any', push_decoded => sub { |
40
|
70
|
|
|
70
|
|
1091
|
push @array, @_; |
41
|
70
|
100
|
|
|
|
966
|
$self->push_decoded->( $self->is_map ? { @array } : \@array) if @array == $size; |
|
|
100
|
|
|
|
|
|
42
|
23
|
|
|
|
|
685
|
} ] ) x $size, |
43
|
|
|
|
|
|
|
[ 'Noop', push_decoded => $self->push_decoded ] ); |
44
|
|
|
|
|
|
|
|
45
|
23
|
|
|
|
|
927
|
return \@next; |
46
|
|
|
|
|
|
|
}; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=pod |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=encoding UTF-8 |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 NAME |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
MsgPack::Decoder::Generator::Array |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 VERSION |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
version 2.0.3 |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 AUTHOR |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Yanick Champoux <yanick@cpan.org> |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
This software is copyright (c) 2019, 2017, 2016, 2015 by Yanick Champoux. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
73
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |