Skip to content

Commit f2abb35

Browse files
committed
[stdlib] remove deinitialize branch (does this do anything?)
1 parent 0590552 commit f2abb35

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
@@ -164,9 +164,9 @@ extension _ArrayBufferProtocol {
164164
let holeStart = elements + subrange.lowerBound
165165
let holeEnd = holeStart + newCount
166166

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

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

0 commit comments

Comments
 (0)