diff options
author | Nicholas Clark <nick@ccl4.org> | 2004-07-13 14:06:36 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2004-07-13 14:06:36 +0000 |
commit | 6c3fb703f2b4baeb80013bb4dcb062d7252ba482 (patch) | |
tree | d035e4fcdc4d46f88cc7e8acf814065412a73eec /ext/B | |
parent | 47d3bbda55847f12d15b91e048e7fa55d4476a43 (diff) | |
download | perl-6c3fb703f2b4baeb80013bb4dcb062d7252ba482.tar.gz |
A proper, working, stable optimisation for sort {$b cmp $a}
p4raw-id: //depot/perl@23096
Diffstat (limited to 'ext/B')
-rw-r--r-- | ext/B/B/Concise.pm | 4 | ||||
-rw-r--r-- | ext/B/t/f_sort.t | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/ext/B/B/Concise.pm b/ext/B/B/Concise.pm index eb9398ab06..ebd5848e60 100644 --- a/ext/B/B/Concise.pm +++ b/ext/B/B/Concise.pm @@ -14,7 +14,7 @@ use warnings; # uses #3 and #4, since warnings uses Carp use Exporter (); # use #5 -our $VERSION = "0.62"; +our $VERSION = "0.63"; our @ISA = qw(Exporter); our @EXPORT_OK = qw( set_style set_style_standard add_callback concise_subref concise_cv concise_main @@ -554,7 +554,7 @@ $priv{"exists"}{64} = "SUB"; $priv{$_}{64} = "LOCALE" for ("sort", "prtf", "sprintf", "slt", "sle", "seq", "sne", "sgt", "sge", "scmp", "lc", "uc", "lcfirst", "ucfirst"); -@{$priv{"sort"}}{1,2,4,8} = ("NUM", "INT", "REV", "INPLACE"); +@{$priv{"sort"}}{1,2,4,8,16} = ("NUM", "INT", "REV", "INPLACE","DESC"); $priv{"threadsv"}{64} = "SVREFd"; @{$priv{$_}}{16,32,64,128} = ("INBIN","INCR","OUTBIN","OUTCR") for ("open", "backtick"); diff --git a/ext/B/t/f_sort.t b/ext/B/t/f_sort.t index f3eec358e6..377b41c99f 100644 --- a/ext/B/t/f_sort.t +++ b/ext/B/t/f_sort.t @@ -154,11 +154,11 @@ checkOptree(note => q{}, # 3 <0> pushmark s # 4 <#> gv[*files] s # 5 <1> rv2av[t7] lK/1 -# 6 <@> sort lKS* +# 6 <@> sort lK/DESC # 7 <0> pushmark s # 8 <#> gv[*articles] s # 9 <1> rv2av[t2] lKRM*/1 -# a <2> aassign[t8] KS +# a <2> aassign[t5] KS # b <1> leavesub[1 ref] K/REFC,1 EOT_EOT # 1 <;> nextstate(main 546 (eval 15):1) v @@ -166,11 +166,11 @@ EOT_EOT # 3 <0> pushmark s # 4 <$> gv(*files) s # 5 <1> rv2av[t3] lK/1 -# 6 <@> sort lKS* +# 6 <@> sort lK/DESC # 7 <0> pushmark s # 8 <$> gv(*articles) s # 9 <1> rv2av[t1] lKRM*/1 -# a <2> aassign[t4] KS +# a <2> aassign[t2] KS # b <1> leavesub[1 ref] K/REFC,1 EONT_EONT @@ -228,11 +228,11 @@ checkOptree(note => q{}, # 3 <0> pushmark s # 4 <#> gv[*files] s # 5 <1> rv2av[t7] lK/1 -# 6 <@> sort lKS* +# 6 <@> sort lK/DESC,NUM # 7 <0> pushmark s # 8 <#> gv[*articles] s # 9 <1> rv2av[t2] lKRM*/1 -# a <2> aassign[t8] KS +# a <2> aassign[t5] KS # b <1> leavesub[1 ref] K/REFC,1 EOT_EOT # 1 <;> nextstate(main 546 (eval 15):1) v @@ -240,11 +240,11 @@ EOT_EOT # 3 <0> pushmark s # 4 <$> gv(*files) s # 5 <1> rv2av[t3] lK/1 -# 6 <@> sort lKS* +# 6 <@> sort lK/DESC,NUM # 7 <0> pushmark s # 8 <$> gv(*articles) s # 9 <1> rv2av[t1] lKRM*/1 -# a <2> aassign[t4] KS +# a <2> aassign[t2] KS # b <1> leavesub[1 ref] K/REFC,1 EONT_EONT |