Skip to content

Commit 6a0fd51

Browse files
Switch UnsafeMutableBufferPointer.subscript to use _modify (#19771)
1 parent 505d839 commit 6a0fd51

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/core/UnsafeBufferPointer.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,10 @@ extension Unsafe${Mutable}BufferPointer: ${Mutable}Collection, RandomAccessColle
273273
return _position![i]
274274
}
275275
%if Mutable:
276-
nonmutating set {
276+
nonmutating _modify {
277277
_debugPrecondition(i >= 0)
278278
_debugPrecondition(i < endIndex)
279-
_position![i] = newValue
279+
yield &_position![i]
280280
}
281281
%end
282282
}

0 commit comments

Comments
 (0)