Skip to content

Commit 9d70c19

Browse files
committed
Remove check for collections fewer than 8 elements
1 parent 9ca2969 commit 9d70c19

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

Sources/Algorithms/Partition.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,6 @@ extension Collection {
283283

284284
let count = self.count
285285

286-
// The overhead of this implementation isn’t worth it for collections fewer
287-
// than 8 elements. Use the simple `Sequence`-based implementation instead.
288-
// This constant was determined using benchmarking. More information:
289-
// https://github.com/apple/swift-algorithms/pull/152#issuecomment-887130149
290-
if count < 8 {
291-
return try _partitioned(belongsInSecondCollection)
292-
}
293-
294286
// Inside of the `initializer` closure, we set what the actual mid-point is.
295287
// We will use this to partitioned the single array into two in constant time.
296288
var midPoint: Int = 0

0 commit comments

Comments
 (0)