chiark / gitweb /
query_routesearch: fix to not complain about >=
[ypp-sc-tools.db-live.git] / yarrg / web / query_routesearch
index 6cf098ed82c63c8cfce1fe93fe6e889460415675..151824cdec7a8a77db75f0b6b1c0c1055a0da2fa 100644 (file)
@@ -59,7 +59,7 @@ my @islandids;
 
 my $destspec;
 
-my @maxmaxdist= qw(35 35 60);
+my @maxmaxdist= qw(100 100 100);
 my $maxcpu=90;
 my $concur_lim=5;
 
@@ -181,7 +181,7 @@ foreach my $k (qw(MaxMass MaxVolume MaxCapital)) {
 }
 push @rsargs, defined $routeparams->{LossPerLeaguePct}
        ? $routeparams->{LossPerLeaguePct}*0.01 : 1e-9;
-push @rsargs, $routeparams->{MinProfit};
+push @rsargs, $routeparams->{MinProfit} // 0;
 push @rsargs, 'search',$maxdist, $maxcountea,$maxcountea;
 push @rsargs, $destspec;
 push @rsargs, @islandids;
@@ -228,7 +228,7 @@ while (<$fh>) {
        }
        die unless m/^ \@ *\d+ ([ap])\# *\d+ \|.*\| *(\d+)lg *\| *\d+ +(\d+) +(\d+) *\| ([0-9 ]+)$/;
        my ($ap,$isles) = (uc $1,$5);
-       next if $results{$ap} && %{$results{$ap}} >= $maxcountea;
+       next if $results{$ap} && keys %{$results{$ap}} >= $maxcountea;
        my $item= { A => $3, P => $4, Leagues => $2 };
        my (@i, @fi, @a);
        foreach (split / /, $isles) {