Skip to content

Commit 575f42e

Browse files
committed
Rule 16.4: Simplify query
1 parent dec57ed commit 575f42e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

c/misra/src/rules/RULE-16-4/EverySwitchShallHaveDefaultLabel.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ where
2323
exists(SwitchCase case, BreakStmt break |
2424
switch.getDefaultCase() = case and
2525
case.getFollowingStmt() = break and
26-
not exists(Comment comment |
27-
break.getLocation().getEndLine() - 1 = comment.getLocation().getEndLine()
28-
) and
26+
not exists(Comment comment | comment.getCommentedElement() = break) and
2927
message =
3028
"has default label that does not terminate in a statement or comment before break statement"
3129
)

0 commit comments

Comments
 (0)