line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Heap::Simple::Function; |
2
|
|
|
|
|
|
|
$VERSION = "0.04"; |
3
|
3
|
|
|
3
|
|
33
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
165
|
|
4
|
3
|
|
|
3
|
|
20
|
use Carp; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
3159
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub _elements { |
7
|
1199
|
|
|
1199
|
|
3448
|
my ($class, $heap, $name, $elements) = @_; |
8
|
1199
|
100
|
|
|
|
3212
|
if (!defined $elements->[1]) { |
9
|
567
|
100
|
|
|
|
4263
|
$class->isa("Heap::Simple::Wrapper") || |
10
|
|
|
|
|
|
|
croak "missing key function for $elements->[0]"; |
11
|
566
|
|
|
|
|
3494
|
return $name, "0"; |
12
|
|
|
|
|
|
|
} |
13
|
632
|
|
|
|
|
1807
|
$heap->[0]{index} = $elements->[1]; |
14
|
632
|
|
|
|
|
3054
|
return $name; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub _ELEMENTS_PREPARE { |
18
|
143
|
|
|
143
|
|
1638
|
return "my \$el_fun = \$heap->[0]{index};"; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub _KEY { |
22
|
723
|
|
|
723
|
|
17015
|
return "\$el_fun->($_[1])"; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub _QUICK_KEY { |
26
|
50
|
|
|
50
|
|
2404
|
return "\$heap->[0]{index}->($_[1])"; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub key_function { |
30
|
40
|
|
|
40
|
0
|
22574
|
return shift->[0]{index}; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub key { |
34
|
9811
|
|
|
9811
|
0
|
1113722
|
return $_[0][0]{index}->($_[1]); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub elements { |
38
|
123
|
100
|
|
123
|
0
|
18446
|
return wantarray ? (Function => shift->[0]{index}) : "Function"; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |