summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/crypto.pm5
1 files changed, 2 insertions, 3 deletions
diff --git a/perl-install/crypto.pm b/perl-install/crypto.pm
index 36912dc69..56af9893c 100644
--- a/perl-install/crypto.pm
+++ b/perl-install/crypto.pm
@@ -89,10 +89,9 @@ sub bestMirror {
++$value;
}
}
- my ($min_value) = sort { $a <=> $b } values %mirror2value;
+ my $min_value = min(values %mirror2value);
- my @possible = grep { $mirror2value{$_} == $min_value } keys %mirror2value;
- push @possible, grep { $mirror2value{$_} == $min_value } keys %mirror2value;
+ my @possible = (grep { $mirror2value{$_} == $min_value } keys %mirror2value) x 2; #- increase probability
push @possible, grep { $mirror2value{$_} == 1 + $min_value } keys %mirror2value;
$possible[rand @possible];