File tree Expand file tree Collapse file tree
csharp/ql/src/Likely Bugs Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,18 +15,6 @@ import csharp
1515import semmle.code.csharp.commons.ComparisonTest
1616import semmle.code.csharp.commons.StructuralComparison as SC
1717
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-
3018private predicate hasChild ( Stmt outer , Element child ) {
3119 outer = child .getParent ( ) and
3220 ( outer instanceof ForStmt or outer = any ( ForStmt f ) .getBody ( ) )
@@ -61,9 +49,7 @@ class NestedForLoopSameVariable extends ForStmt {
6149 }
6250
6351 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 ( ) )
6753 }
6854
6955 private predicate haveSameUpdate ( ) {
You can’t perform that action at this time.
0 commit comments