Skip to content

Commit b1e2990

Browse files
committed
Only compute necessary blocks
1 parent 36f87ac commit b1e2990

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Sources/LiveViewNative/LiveContext.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ public struct LiveContext<R: CustomRegistry> {
6464
return false
6565
}
6666
})
67-
let defaultSlotChildren = children.filter({
68-
if case let .element(element) = $0.data {
69-
return element.namespace != tagName
70-
} else {
71-
return true
72-
}
73-
})
7467
if namedSlotChildren.isEmpty && includeDefaultSlot {
68+
let defaultSlotChildren = children.filter({
69+
if case let .element(element) = $0.data {
70+
return element.namespace != tagName
71+
} else {
72+
return true
73+
}
74+
})
7575
return ForEach(defaultSlotChildren.map({ ($0.id, $0.children()) }), id: \.0) { subChildren in
7676
coordinator.builder.fromNodes(subChildren.1, context: self)
7777
}

0 commit comments

Comments
 (0)