Skip to content

Commit 33509d5

Browse files
committed
A16-0-1: simplify query logic
1 parent dbfa05d commit 33509d5

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

cpp/autosar/src/rules/A16-0-1/PreProcessorShallOnlyBeUsedForCertainDirectivesPatterns.ql

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,9 @@ predicate isPreprocConditionalRange(
5454
PreprocessorBranch pb, string filepath, int startLine, int endLine
5555
) {
5656
isPreprocFileAndLine(pb, filepath, startLine) and
57-
endLine =
58-
min(int elifEndLine, PreprocessorDirective end |
59-
pb.getNext() = end and isPreprocFileAndLine(end, filepath, elifEndLine)
60-
|
61-
elifEndLine
62-
)
57+
exists(PreprocessorDirective end |
58+
pb.getNext() = end and isPreprocFileAndLine(end, filepath, endLine)
59+
)
6360
}
6461

6562
/**

0 commit comments

Comments
 (0)