We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 79c7ca0 commit 787b92dCopy full SHA for 787b92d
Sources/GraphQL/SwiftUtilities/SuggestionList.swift
@@ -20,7 +20,12 @@ func suggestionList(
20
}
21
return optionsByDistance.keys.sorted {
22
// Values are guaranteed non-nil since the keys come from the object itself
23
- optionsByDistance[$0]! - optionsByDistance[$1]! != 0
+ let distanceDiff = optionsByDistance[$0]! - optionsByDistance[$1]!
24
+ if distanceDiff != 0 {
25
+ return distanceDiff < 0
26
+ } else {
27
+ return $0.lexicographicallyPrecedes($1)
28
+ }
29
30
31
0 commit comments