[padb-devel] [padb] r255 committed - Check the use of sort elsewhere in the codebase, remove a couple that ...
codesite-noreply at google.com
codesite-noreply at google.com
Tue Sep 15 15:17:04 BST 2009
Revision: 255
Author: apittman
Date: Tue Sep 15 07:15:56 2009
Log: Check the use of sort elsewhere in the codebase, remove a couple that
weren't needed
and where we sort pids sort them numerically.
http://code.google.com/p/padb/source/detail?r=255
Modified:
/branches/cleanup/src/padb
=======================================
--- /branches/cleanup/src/padb Tue Sep 15 05:07:01 2009
+++ /branches/cleanup/src/padb Tue Sep 15 07:15:56 2009
@@ -3061,7 +3061,7 @@
my ($r) = @_;
my @all;
- foreach my $value ( sort keys %{$r} ) {
+ foreach my $value ( keys %{$r} ) {
while ( defined( my $rank = rng_shift( $r->{$value} ) ) ) {
$all[$rank] = $value;
}
@@ -3138,7 +3138,7 @@
my @all;
my $lines = tree_from_namespace( $nlines->{target_data} );
- foreach my $tag ( sort keys %{$lines} ) {
+ foreach my $tag ( keys %{$lines} ) {
my %hash;
$hash{vp} = $tag;
foreach my $key ( keys %{ $lines->{$tag} } ) {
@@ -7229,14 +7229,14 @@
my $newpid;
if ( defined $ip->{scripts} ) {
- my @ppids = sort @{ $ip->{scripts} };
+ my @ppids = sort { $a <=> $b } @{ $ip->{scripts} };
$newpid = $ppids[0];
}
# If there are any pids which aren't scripts then target the
# first one.
if ( defined $ip->{notscripts} ) {
- my @ppids = sort @{ $ip->{notscripts} };
+ my @ppids = sort { $a <=> $b } @{ $ip->{notscripts} };
$newpid = $ppids[0];
}
More information about the padb-devel
mailing list