Skip to content

Commit 191f256

Browse files
committed
Fix dictionary mutate issue
1 parent 58e74a2 commit 191f256

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sources/OpenSwiftUICore/View/Graph/ViewGraphGeometryObservers.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ package struct ViewGraphGeometryObservers<Measurer> where Measurer: ViewGraphGeo
5151
return false
5252
}
5353
var result = false
54-
for proposal in store.keys {
54+
let keys = store.keys
55+
for proposal in keys {
5556
let size = Measurer.measure(given: proposal, in: graph)
5657
let changed = store[proposal]!.storage.transition(to: size)
5758
result = result || changed
@@ -67,7 +68,8 @@ package struct ViewGraphGeometryObservers<Measurer> where Measurer: ViewGraphGeo
6768
/// - Returns: A dictionary mapping proposals to their new sizes that need notification.
6869
package mutating func notifySizes() -> [Proposal: Size] {
6970
var result: [Proposal: Size] = [:]
70-
for proposal in store.keys {
71+
let keys = store.keys
72+
for proposal in keys {
7173
if let size = store[proposal]!.sizeToNotifyIfNeeded() {
7274
result[proposal] = size
7375
}

0 commit comments

Comments
 (0)