chiark / gitweb /
query_routesearch: fix to not complain about >=
[ypp-sc-tools.db-test.git] / yarrg / web / query_routesearch
index 87e9d33649bbbb0846f2efc08325f7c0d46d33c1..151824cdec7a8a77db75f0b6b1c0c1055a0da2fa 100644 (file)
@@ -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) {