Skip to content

Commit 5ef8c54

Browse files
committed
[docs] clarify todo about deinitializing a single element
1 parent 367b4c1 commit 5ef8c54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/core/UnsafePointer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -888,8 +888,8 @@ public struct UnsafeMutablePointer<Pointee>: _Pointer, Sendable {
888888
@discardableResult
889889
public func deinitialize(count: Int) -> UnsafeMutableRawPointer {
890890
_debugPrecondition(count >= 0, "UnsafeMutablePointer.deinitialize with negative count")
891-
// FIXME: optimization should be implemented, where if the `count` value
892-
// is 1, the `Builtin.destroy(Pointee.self, _rawValue)` gets called.
891+
// TODO: IRGen optimization when `count` value is statically known to be 1,
892+
// then call `Builtin.destroy(Pointee.self, _rawValue)` instead.
893893
Builtin.destroyArray(Pointee.self, _rawValue, count._builtinWordValue)
894894
return UnsafeMutableRawPointer(self)
895895
}

0 commit comments

Comments
 (0)