We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c096203 commit 0590552Copy full SHA for 0590552
stdlib/public/core/ArrayBufferProtocol.swift
@@ -169,11 +169,10 @@ extension _ArrayBufferProtocol {
169
}
170
171
// resize the hole to make it the correct size
172
- if growth != 0 {
173
- let tailStart = elements + subrange.upperBound
174
- let tailCount = oldCount - subrange.upperBound
175
- holeEnd.moveInitialize(from: tailStart, count: tailCount)
176
- }
+ // safe to always call, moveInitialize to the same location is a no-op
+ let tailStart = elements + subrange.upperBound
+ let tailCount = oldCount - subrange.upperBound
+ holeEnd.moveInitialize(from: tailStart, count: tailCount)
177
178
// place the values into the hole we created
179
if newCount > 0 {
0 commit comments