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 a385dec commit 0aafb38Copy full SHA for 0aafb38
stdlib/public/core/ArrayBufferProtocol.swift
@@ -165,11 +165,10 @@ extension _ArrayBufferProtocol {
165
}
166
167
// resize the hole to make it the correct size
168
- if growth != 0 {
169
- let tailStart = elements + subrange.upperBound
170
- let tailCount = oldCount - subrange.upperBound
171
- holeEnd.moveInitialize(from: tailStart, count: tailCount)
172
- }
+ // 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)
173
174
// place the values into the hole we created
175
if newCount > 0 {
0 commit comments