get sorting of query result right
This commit is contained in:
@ -36,11 +36,13 @@ impl Query {
|
||||
}
|
||||
|
||||
if score >= required_score {
|
||||
results.push((score, texture))
|
||||
// multiply by -1 to get order right.
|
||||
results.push((score * -1, texture))
|
||||
}
|
||||
}
|
||||
|
||||
results.sort_by_key(|(score, _)| score * -1);
|
||||
// We can sort unstable, since at least the IDs are different.
|
||||
results.sort_unstable();
|
||||
|
||||
results
|
||||
.iter()
|
||||
|
Reference in New Issue
Block a user