forked from hans/Nominatim
ensure that ordering by importance is stable
The initial search results retrieved from the database already come preordered, either by importnace or by distance. We want to keep that order if all other things are equal.
This commit is contained in:
@@ -55,7 +55,7 @@ function byImportance($a, $b)
|
||||
if ($a['importance'] != $b['importance'])
|
||||
return ($a['importance'] > $b['importance']?-1:1);
|
||||
|
||||
return ($a['foundorder'] < $b['foundorder']?-1:1);
|
||||
return $a['foundorder'] <=> $b['foundorder'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user