mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] Kill some dead code
That this code is dead implies we are throwing away the knowledge that we have a native buffer whenever we downcast an array. That'll be fixed when the array buffer simplification goes in. Swift SVN r23350
This commit is contained in:
@@ -213,15 +213,12 @@ extension _ArrayBuffer {
|
||||
if !_isClassOrObjCExistential(T.self) {
|
||||
return
|
||||
}
|
||||
|
||||
if _slowPath(indirect.needsElementTypeCheck) {
|
||||
if _fastPath(_isNative) {
|
||||
for x in _native[subRange] {
|
||||
_precondition(
|
||||
unsafeBitCast(x, AnyObject.self) is T,
|
||||
"NSArray element failed to match the Swift Array Element type")
|
||||
}
|
||||
}
|
||||
else if !subRange.isEmpty {
|
||||
_sanityCheck(
|
||||
!_isNative, "A native array that needs a type check?")
|
||||
|
||||
if !subRange.isEmpty {
|
||||
let ns = _nonNative
|
||||
// Could be sped up, e.g. by using
|
||||
// enumerateObjectsAtIndexes:options:usingBlock:
|
||||
|
||||
Reference in New Issue
Block a user