Skip to content

Commit

Permalink
Fix condition
Browse files Browse the repository at this point in the history
  • Loading branch information
alrz committed Aug 15, 2019
1 parent 6078380 commit 1cd3268
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private SyntaxKind AnalyzeSwitchStatement(SwitchStatementSyntax switchStatement,
// Fail if the switch statement is empty or any of sections have more than one "case" label.
// Once we have "or" patterns, we can relax this to accept multi-case sections.
var sections = switchStatement.Sections;
if (sections.Count == 0 || sections.Any(s => s.Labels.Count != 1 || !s.Labels.Any(x => x.IsKind(SyntaxKind.DefaultSwitchLabel))))
if (sections.Count == 0 || !sections.All(s => s.Labels.Count == 1 || s.Labels.Any(x => x.IsKind(SyntaxKind.DefaultSwitchLabel))))
{
return default;
}
Expand Down

0 comments on commit 1cd3268

Please sign in to comment.