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 379609b commit 435a38cCopy full SHA for 435a38c
Sources/Algorithms/PartialSort.swift
@@ -43,7 +43,8 @@ extension Collection {
43
// Make sure we are within bounds.
44
let prefixCount = Swift.min(count, self.count)
45
46
- // If we're attempting to prefix more than 10% of the collection, it's faster to sort everything.
+ // If we're attempting to prefix more than 10% of the collection, it's
47
+ // faster to sort everything.
48
guard prefixCount < (self.count / 10) else {
49
return Array(try sorted(by: areInIncreasingOrder).prefix(prefixCount))
50
}
0 commit comments