File tree Expand file tree Collapse file tree
csharp/ql/lib/semmle/code/csharp/commons Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,31 +105,12 @@ private module ConstantComparisonOperation {
105105 }
106106}
107107
108- private class StructuralComparisonConfig extends StructuralComparison:: StructuralComparisonConfiguration {
109- StructuralComparisonConfig ( ) { this = "CompareIdenticalValues" }
110-
111- override predicate candidate ( ControlFlowElement x , ControlFlowElement y ) {
112- exists ( ComparisonTest ct |
113- x = ct .getFirstArgument ( ) and
114- y = ct .getSecondArgument ( )
115- )
116- }
117-
118- ComparisonTest getComparisonTest ( ) {
119- exists ( Element x , Element y |
120- result .getFirstArgument ( ) = x and
121- result .getSecondArgument ( ) = y and
122- same ( x , y )
123- )
124- }
125- }
126-
127108/**
128109 * Holds if comparison test `ct` compares two structurally identical
129110 * expressions.
130111 */
131112predicate comparesIdenticalValues ( ComparisonTest ct ) {
132- ct = any ( StructuralComparisonConfig c ) . getComparisonTest ( )
113+ StructuralComparison :: sameGvn ( ct . getFirstArgument ( ) , ct . getSecondArgument ( ) )
133114}
134115
135116/**
You can’t perform that action at this time.
0 commit comments