Skip to content

Commit c9ce9b6

Browse files
committed
Add explanatory comment
1 parent 99a94bc commit c9ce9b6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cpp/common/src/codingstandards/cpp/Loops.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ class MemberAssignmentOperation extends FunctionCall {
7070
*/
7171
pragma[noopt]
7272
Variable getALoopCounter(ForStmt fs) {
73+
// ------------------------------------------------------------------------------------------------
74+
// NOTE: This is an updated version of ForStmt.getAnIterationVariable(), handling additional cases.
75+
// The use of pragma[noopt] is retained from the original code, as we haven't determined
76+
// whether it's still necessary across a broad range of databases. As a noopt predicate, it
77+
// includes a degree of duplication as the join order is defined based on the order of the
78+
// conditions.
79+
// ------------------------------------------------------------------------------------------------
7380
// check that it is assigned to, incremented or decremented in the update
7481
exists(Expr updateOpRoot, Expr updateOp |
7582
updateOpRoot = fs.getUpdate() and

0 commit comments

Comments
 (0)