line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
11
|
|
|
11
|
|
44
|
use strict; |
|
11
|
|
|
|
|
14
|
|
|
11
|
|
|
|
|
366
|
|
2
|
11
|
|
|
11
|
|
49
|
use warnings; |
|
11
|
|
|
|
|
15
|
|
|
11
|
|
|
|
|
476
|
|
3
|
|
|
|
|
|
|
package |
4
|
|
|
|
|
|
|
Hash::MostUtils::leach; # don't index me, please |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use provide ( |
7
|
11
|
|
|
|
|
64
|
if => ge => 5.013 => 'Hash::MostUtils::leach::v5_13', |
8
|
|
|
|
|
|
|
else => 'Hash::MostUtils::leach::v5_10', |
9
|
11
|
|
|
11
|
|
4758
|
); |
|
11
|
|
|
|
|
13544
|
|
10
|
|
|
|
|
|
|
|
11
|
11
|
|
|
11
|
|
1165
|
use Scalar::Util qw(refaddr); |
|
11
|
|
|
|
|
17
|
|
|
11
|
|
|
|
|
2396
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
{ |
14
|
|
|
|
|
|
|
my %end; |
15
|
|
|
|
|
|
|
my %size; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# n-ary each for lists |
18
|
|
|
|
|
|
|
sub _n_each { |
19
|
874
|
|
|
874
|
|
724
|
my $n = shift; |
20
|
874
|
|
|
|
|
692
|
my $data = shift; |
21
|
|
|
|
|
|
|
|
22
|
874
|
|
|
|
|
997
|
my $ident = refaddr($data); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# does it look hashlike? cast to an array ref for indexing. |
25
|
|
|
|
|
|
|
$data = [ %$data ] if |
26
|
874
|
100
|
|
|
|
601
|
do { local $@; eval { scalar keys %$data; 1 } }; |
|
874
|
|
|
|
|
598
|
|
|
874
|
|
|
|
|
745
|
|
|
874
|
|
|
|
|
886
|
|
|
842
|
|
|
|
|
2315
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# did the size change? if so, zero out our %end |
29
|
874
|
100
|
|
|
|
1344
|
if (exists $size{$ident}) { |
30
|
766
|
100
|
|
|
|
608
|
if ($size{$ident} != $#{$data}) { |
|
766
|
|
|
|
|
1174
|
|
31
|
201
|
|
|
|
|
145
|
$size{$ident} = $#{$data}; |
|
201
|
|
|
|
|
192
|
|
32
|
201
|
|
|
|
|
199
|
$end{$ident} = 0; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} else { |
35
|
108
|
|
|
|
|
80
|
$size{$ident} = $#{$data}; |
|
108
|
|
|
|
|
178
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
874
|
100
|
100
|
|
|
606
|
if ($#{$data} < ($end{$ident} || 0)) { |
|
874
|
|
|
|
|
2188
|
|
39
|
113
|
|
|
|
|
119
|
delete $end{$ident}; |
40
|
113
|
|
|
|
|
198
|
return (); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
761
|
|
|
|
|
746
|
$end{$ident} += $n; |
44
|
761
|
|
|
|
|
915
|
return @{$data}[$end{$ident} - $n .. $end{$ident} - 1]; |
|
761
|
|
|
|
|
1530
|
|
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |