Skip to content

Commit 7912c40

Browse files
Update cpp/misra/src/rules/RULE-28-6-4/PotentiallyErroneousContainerUsage.ql
Co-authored-by: Mauro Baluda <mbaluda@github.com>
1 parent 62ea25f commit 7912c40

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

cpp/misra/src/rules/RULE-28-6-4/PotentiallyErroneousContainerUsage.ql

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,7 @@ predicate isEmptyCall(FunctionCall fc) {
3939
from FunctionCall fc, string message
4040
where
4141
not isExcluded(fc, DeadCode11Package::potentiallyErroneousContainerUsageQuery()) and
42-
exists(ExprStmt es | es.getExpr() = fc) and
43-
(
44-
isRemoveOrUniqueCall(fc) and
45-
message = "Result of call to '" + fc.getTarget().getName() + "' is not used."
46-
or
47-
isEmptyCall(fc) and
48-
message = "Result of call to 'empty' is not used."
49-
)
42+
fc = any(ExprStmt es).getExpr() and
43+
(isRemoveOrUniqueCall(fc) or isEmptyCall(fc)) and
44+
message = "Result of call to '" + fc.getTarget().getName() + "' is not used."
5045
select fc, message

0 commit comments

Comments
 (0)