Skip to content

Commit 2292df3

Browse files
Swiftch Dictionary.subscript(_:default:) to use _modify (#19218)
1 parent af39acc commit 2292df3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/core/Dictionary.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,11 +926,11 @@ extension Dictionary {
926926
get {
927927
return _variant.maybeGet(key) ?? defaultValue()
928928
}
929-
mutableAddressWithNativeOwner {
929+
_modify {
930930
let (_, address) = _variant.pointerToValue(
931931
forKey: key,
932932
insertingDefault: defaultValue)
933-
return (address, Builtin.castToNativeObject(_variant.asNative._storage))
933+
yield &address.pointee
934934
}
935935
}
936936

0 commit comments

Comments
 (0)