Skip to content

Commit 327e18a

Browse files
authored
Faster variadic view (#73)
1 parent acd1e0c commit 327e18a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Sources/SnapshotPreviewsCore/ViewInspection.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ import SwiftUI
1010
fileprivate struct ViewSelector: _VariadicView_MultiViewRoot {
1111
let position: Int
1212
func body(children: _VariadicView.Children) -> some View {
13-
ForEach(Array(children.enumerated()), id: \.0) { count, item in
14-
if count == position {
15-
item
16-
}
17-
}
13+
children[position]
1814
}
1915
}
2016

0 commit comments

Comments
 (0)