Skip to content

Commit dcdda8c

Browse files
committed
Fix unreasonable condition
1 parent 88fadc7 commit dcdda8c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Sources/SwiftParserDiagnostics/MissingNodesError.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,7 @@ fileprivate enum NodesDescriptionPart {
3636
switch self {
3737
case .tokensWithDefaultText(var tokens):
3838
if format {
39-
tokens = tokens.enumerated()
40-
.map { index, token in
41-
// We detach the nodes from the second one onwards, considering the line indentation only for the first node
42-
NoNewlinesFormat(viewMode: .all).visit(index == 0 ? token : token.detached)
43-
}
39+
tokens = tokens.map { NoNewlinesFormat(viewMode: .all).visit($0.detached) }
4440
}
4541
if !tokens.isEmpty {
4642
tokens[0] = tokens[0].with(\.leadingTrivia, [])

0 commit comments

Comments
 (0)