File tree Expand file tree Collapse file tree 1 file changed +1
-15
lines changed
csharp/ql/src/Likely Bugs Expand file tree Collapse file tree 1 file changed +1
-15
lines changed Original file line number Diff line number Diff line change @@ -15,18 +15,6 @@ import csharp
15
15
import semmle.code.csharp.commons.ComparisonTest
16
16
import semmle.code.csharp.commons.StructuralComparison as SC
17
17
18
- /** A structural comparison configuration for comparing the conditions of nested `for` loops. */
19
- class NestedForConditions extends SC:: StructuralComparisonConfiguration {
20
- NestedForConditions ( ) { this = "Compare nested for conditions" }
21
-
22
- override predicate candidate ( ControlFlowElement e1 , ControlFlowElement e2 ) {
23
- exists ( NestedForLoopSameVariable nested |
24
- e1 = nested .getInnerForStmt ( ) .getCondition ( ) and
25
- e2 = nested .getOuterForStmt ( ) .getCondition ( )
26
- )
27
- }
28
- }
29
-
30
18
private predicate hasChild ( Stmt outer , Element child ) {
31
19
outer = child .getParent ( ) and
32
20
( outer instanceof ForStmt or outer = any ( ForStmt f ) .getBody ( ) )
@@ -61,9 +49,7 @@ class NestedForLoopSameVariable extends ForStmt {
61
49
}
62
50
63
51
private predicate haveSameCondition ( ) {
64
- exists ( NestedForConditions config |
65
- config .same ( this .getInnerForStmt ( ) .getCondition ( ) , this .getOuterForStmt ( ) .getCondition ( ) )
66
- )
52
+ SC:: sameGvn ( this .getInnerForStmt ( ) .getCondition ( ) , this .getOuterForStmt ( ) .getCondition ( ) )
67
53
}
68
54
69
55
private predicate haveSameUpdate ( ) {
You can’t perform that action at this time.
0 commit comments