Skip to content

Commit 243db9e

Browse files
authored
Merge pull request #575 from ahoppen/ahoppen/syntax-collection-range-replaceable
Use `where` instead of filter for `for` loops
2 parents 825f3f0 + aff4e09 commit 243db9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ fileprivate final class TokenStreamCreator: SyntaxVisitor {
759759

760760
// An if-configuration clause around a switch-case encloses the case's node, so an
761761
// if-configuration clause requires a break here in order to be allowed on a new line.
762-
for ifConfigDecl in node.cases.filter({ $0.is(IfConfigDeclSyntax.self) }) {
762+
for ifConfigDecl in node.cases where ifConfigDecl.is(IfConfigDeclSyntax.self) {
763763
if config.indentSwitchCaseLabels {
764764
before(ifConfigDecl.firstToken(viewMode: .sourceAccurate), tokens: .break(.open))
765765
after(ifConfigDecl.lastToken(viewMode: .sourceAccurate), tokens: .break(.close, size: 0))

0 commit comments

Comments
 (0)