[stdlib] Update partition tests with feedback

This commit is contained in:
Nate Cook
2016-07-15 00:39:25 -05:00
parent 13d1ac5b81
commit 29bbff221b
4 changed files with 44 additions and 84 deletions

View File

@@ -76,10 +76,8 @@ extension MutableCollection
where Self: RandomAccessCollection, Self.Iterator.Element : Comparable {
public final mutating func myPartition() -> Index {
if let first = self.first {
return self.partition(by: { $0 >= first})
}
return self.startIndex
let first = self.first
return self.partition(by: { $0 >= first! })
}
}