Skip to content

Commit fa83a71

Browse files
authored
Optimize AnyView implementation (#70)
1 parent 26b2eec commit fa83a71

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/OpenSwiftUI/Core/View/ViewOutputs.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public struct _ViewOutputs {
4141
key.visitKey(&visitor)
4242
}
4343
if let layoutComputer = $layoutComputer {
44-
layoutComputer.identifier.source = (layoutComputer.graph.graphHost() as! ViewGraph).$defaultLayoutComputer.identifier
44+
layoutComputer.identifier.source = unsafeDowncast(layoutComputer.graph.graphHost(), to: ViewGraph.self).$defaultLayoutComputer.identifier
4545
}
4646
#endif
4747
}

Sources/OpenSwiftUI/View/View/AnyView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ private struct AnyViewContainer: StatefulRule, AsyncAttribute {
184184
newInfo = oldInfo
185185
} else {
186186
eraseItem(info: oldInfo)
187-
newInfo = makeItem(view.storage, uniqueId: oldInfo.uniqueID + 1)
187+
newInfo = makeItem(view.storage, uniqueId: oldInfo.uniqueID &+ 1)
188188
}
189189
} else {
190190
newInfo = makeItem(view.storage, uniqueId: 0)

0 commit comments

Comments
 (0)