line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Sort::Naturally::XS; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
100992
|
use 5.010001; |
|
4
|
|
|
|
|
21
|
|
4
|
4
|
|
|
4
|
|
56
|
use strict; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
102
|
|
5
|
4
|
|
|
4
|
|
22
|
use warnings; |
|
4
|
|
|
|
|
14
|
|
|
4
|
|
|
|
|
120
|
|
6
|
4
|
|
|
4
|
|
53
|
use Carp; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
380
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
require Exporter; |
9
|
4
|
|
|
4
|
|
2446
|
use AutoLoader; |
|
4
|
|
|
|
|
6725
|
|
|
4
|
|
|
|
|
998
|
|
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.7'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
require XSLoader; |
20
|
|
|
|
|
|
|
XSLoader::load('Sort::Naturally::XS', $VERSION); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub sorted { |
23
|
9
|
|
|
9
|
1
|
10855
|
my ($ar, %kwargs) = @_; |
24
|
|
|
|
|
|
|
|
25
|
9
|
50
|
|
|
|
32
|
Carp::confess('Not an ARRAY ref') if (ref $ar ne 'ARRAY'); |
26
|
|
|
|
|
|
|
|
27
|
9
|
|
|
|
|
17
|
my $ar_copy = [@{$ar}]; |
|
9
|
|
|
|
|
31
|
|
28
|
9
|
100
|
|
|
|
24
|
my $reverse = $kwargs{reverse} ? 1 : 0; |
29
|
9
|
|
50
|
|
|
39
|
my $locale = $kwargs{locale} || ''; |
30
|
|
|
|
|
|
|
|
31
|
9
|
|
|
|
|
210
|
_sorted($ar_copy, $reverse, $locale); |
32
|
|
|
|
|
|
|
|
33
|
9
|
|
|
|
|
40
|
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__ |