line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Sort::Sub::record_by_reverse_order; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY |
4
|
|
|
|
|
|
|
our $DATE = '2020-02-28'; # DATE |
5
|
|
|
|
|
|
|
our $DIST = 'Sort-Sub'; # DIST |
6
|
|
|
|
|
|
|
our $VERSION = '0.118'; # VERSION |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
22
|
use 5.010001; |
|
1
|
|
|
|
|
3
|
|
9
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
10
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
103
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub meta { |
13
|
|
|
|
|
|
|
return { |
14
|
0
|
|
|
0
|
0
|
0
|
v => 1, |
15
|
|
|
|
|
|
|
compares_record => 1, |
16
|
|
|
|
|
|
|
}; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub gen_sorter { |
20
|
3
|
|
|
3
|
0
|
7
|
my ($is_reverse, $is_ci) = @_; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub { |
23
|
1
|
|
|
1
|
|
8
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
169
|
|
24
|
|
|
|
|
|
|
|
25
|
12
|
|
|
12
|
|
19
|
my $caller = caller(); |
26
|
12
|
50
|
|
|
|
24
|
my $a = @_ ? $_[0] : ${"$caller\::a"}; |
|
0
|
|
|
|
|
0
|
|
27
|
12
|
50
|
|
|
|
18
|
my $b = @_ ? $_[1] : ${"$caller\::b"}; |
|
0
|
|
|
|
|
0
|
|
28
|
|
|
|
|
|
|
|
29
|
12
|
|
|
|
|
17
|
my $cmp = $b->[1] <=> $a->[1]; |
30
|
12
|
100
|
|
|
|
31
|
$is_reverse ? -1*$cmp : $cmp; |
31
|
3
|
|
|
|
|
17
|
}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
# ABSTRACT: |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |