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:
Sarah Hoffmann
2020-08-26 17:42:43 +02:00
parent 9e1909643c
commit 72ee1abc90

View File

@@ -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'];
}