Skip to content

Commit 54971e0

Browse files
oxyLucy Satheesan
authored andcommitted
[stdlib] remove deinitialize branch (does this do anything?)
1 parent 64078f3 commit 54971e0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/public/core/ArrayBufferProtocol.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ extension _ArrayBufferProtocol {
160160
let holeStart = elements + subrange.lowerBound
161161
let holeEnd = holeStart + newCount
162162

163-
if eraseCount > 0 {
164-
holeStart.deinitialize(count: eraseCount)
165-
}
163+
// directly forwards to Builtin.destroyArray
164+
// TODO: should we branch here or does the compiler branch implicitly?
165+
holeStart.deinitialize(count: eraseCount)
166166

167167
// resize the hole to make it the correct size
168168
// safe to always call, moveInitialize to the same location is a no-op

0 commit comments

Comments
 (0)