line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Sort::Naturally::XS; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
284478
|
use 5.010001; |
|
4
|
|
|
|
|
51
|
|
4
|
4
|
|
|
4
|
|
25
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
103
|
|
5
|
4
|
|
|
4
|
|
22
|
use warnings; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
130
|
|
6
|
4
|
|
|
4
|
|
24
|
use Carp; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
280
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
require Exporter; |
9
|
4
|
|
|
4
|
|
1361
|
use AutoLoader; |
|
4
|
|
|
|
|
5710
|
|
|
4
|
|
|
|
|
24
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @ISA = qw/Exporter/; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our @EXPORT = qw/ncmp nsort/; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our @EXPORT_OK = qw/sorted/; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our $VERSION = '0.7.8'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
require XSLoader; |
20
|
|
|
|
|
|
|
XSLoader::load('Sort::Naturally::XS', $VERSION); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub sorted { |
23
|
9
|
|
|
9
|
1
|
9578
|
my ($ar, %kwargs) = @_; |
24
|
|
|
|
|
|
|
|
25
|
9
|
50
|
|
|
|
26
|
Carp::confess('Not an ARRAY ref') if (ref $ar ne 'ARRAY'); |
26
|
|
|
|
|
|
|
|
27
|
9
|
|
|
|
|
14
|
my $ar_copy = [@{$ar}]; |
|
9
|
|
|
|
|
32
|
|
28
|
9
|
100
|
|
|
|
23
|
my $reverse = $kwargs{reverse} ? 1 : 0; |
29
|
9
|
|
50
|
|
|
31
|
my $locale = $kwargs{locale} || ''; |
30
|
|
|
|
|
|
|
|
31
|
9
|
|
|
|
|
199
|
_sorted($ar_copy, $reverse, $locale); |
32
|
|
|
|
|
|
|
|
33
|
9
|
|
|
|
|
38
|
return $ar_copy; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# Preloaded methods go here. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# Autoload methods go after =cut, and are processed by the autosplit program. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
__END__ |