Permalink
Browse files

fixing the warnings issue with order

  • Loading branch information...
1 parent 7276b3c commit 99c4f4fb5c65dbb8936e08b90cdaa3b17440c39f ben hengst committed Sep 11, 2009
Showing with 5 additions and 1 deletion.
  1. +5 −1 bin/bench
View
@@ -52,10 +52,14 @@ $requested->{interp} = {map{ $_ => [map{$_}
#---------------------------------------------------------------------------
my $runs = build_runs($requested);
+my $order_numeric = { map{$_ => 1} qw{min avg max file} };
+
if (scalar(@$runs)
&& defined $requested->{opt}->{order}
&& scalar( grep{$_ eq $requested->{opt}->{order}} keys %{$runs->[0]} )) {
- $runs = [sort {$a->{$requested->{opt}->{order}} <=> $b->{$requested->{opt}->{order}}} @$runs];
+ $runs = ($order_numeric->{$requested->{opt}->{order}})
+ ? [sort {$a->{$requested->{opt}->{order}} <=> $b->{$requested->{opt}->{order}}} @$runs]
+ : [sort {$a->{$requested->{opt}->{order}} cmp $b->{$requested->{opt}->{order}}} @$runs];
}
#---------------------------------------------------------------------------

0 comments on commit 99c4f4f

Please sign in to comment.