mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] remove unsafe escaping closure hack
This commit is contained in:
@@ -447,24 +447,20 @@ ${orderingExplanation}
|
||||
by areInIncreasingOrder:
|
||||
(${IElement}, ${IElement}) -> Bool
|
||||
) {
|
||||
typealias EscapingBinaryPredicate =
|
||||
(Iterator.Element, Iterator.Element) -> Bool
|
||||
let escapableIsOrderedBefore =
|
||||
unsafeBitCast(areInIncreasingOrder, to: EscapingBinaryPredicate.self)
|
||||
|
||||
let didSortUnsafeBuffer: Void? =
|
||||
_withUnsafeMutableBufferPointerIfSupported {
|
||||
(baseAddress, count) -> Void in
|
||||
var bufferPointer =
|
||||
UnsafeMutableBufferPointer(start: baseAddress, count: count)
|
||||
bufferPointer.sort(by: escapableIsOrderedBefore)
|
||||
bufferPointer.sort(by: areInIncreasingOrder)
|
||||
return ()
|
||||
}
|
||||
if didSortUnsafeBuffer == nil {
|
||||
_introSort(
|
||||
&self,
|
||||
subRange: startIndex..<endIndex,
|
||||
by: escapableIsOrderedBefore)
|
||||
by: areInIncreasingOrder)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user