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.2'; |
4
|
3
|
|
|
3
|
|
1554
|
use Moose; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
22
|
|
5
|
3
|
|
|
3
|
|
21456
|
use MooseX::MungeHas 'is_ro'; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
27
|
|
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
|
|
927
|
has '+bytes' => sub { 0 }; |
23
|
|
|
|
|
|
|
|
24
|
19
|
|
|
19
|
|
777
|
has is_map => sub { 0 }; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
has '+next' => sub { |
27
|
23
|
|
|
23
|
|
447
|
my $self = shift; |
28
|
|
|
|
|
|
|
|
29
|
23
|
|
|
|
|
600
|
my $size= $self->size; |
30
|
23
|
100
|
|
|
|
741
|
$size *= 2 if $self->is_map; |
31
|
|
|
|
|
|
|
|
32
|
23
|
50
|
|
|
|
241
|
unless( $size ) { |
33
|
0
|
0
|
|
|
|
0
|
$self->push_decoded->( $self->is_map ? {} : [] ); |
34
|
0
|
|
|
|
|
0
|
return []; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
23
|
|
|
|
|
46
|
my @array; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
my @next = ( ( ['Any', push_decoded => sub { |
40
|
70
|
|
|
70
|
|
1184
|
push @array, @_; |
41
|
70
|
100
|
|
|
|
1029
|
$self->push_decoded->( $self->is_map ? { @array } : \@array) if @array == $size; |
|
|
100
|
|
|
|
|
|
42
|
23
|
|
|
|
|
795
|
} ] ) x $size, |
43
|
|
|
|
|
|
|
[ 'Noop', push_decoded => $self->push_decoded ] ); |
44
|
|
|
|
|
|
|
|
45
|
23
|
|
|
|
|
1024
|
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.2 |
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 |