Skip to content

Commit 138eb48

Browse files
committed
C#: Address review comments.
1 parent ba67ea0 commit 138eb48

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

csharp/ql/src/Language Abuse/MissedTernaryOpportunity.ql

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,14 @@ private Expr getAssignedExpr(Stmt stmt) {
1616
result = stmt.stripSingletonBlocks().(ExprStmt).getExpr().(AssignExpr).getLValue()
1717
}
1818

19-
private predicate ifStmt(IfStmt is) {
20-
sameGvn(getAssignedExpr(is.getThen()), getAssignedExpr(is.getElse()))
21-
}
22-
2319
from IfStmt is, string what
2420
where
2521
(
2622
is.getThen().stripSingletonBlocks() instanceof ReturnStmt and
2723
is.getElse().stripSingletonBlocks() instanceof ReturnStmt and
2824
what = "return"
2925
or
30-
ifStmt(is) and
26+
sameGvn(getAssignedExpr(is.getThen()), getAssignedExpr(is.getElse())) and
3127
what = "write to the same variable"
3228
) and
3329
not exists(IfStmt other | is = other.getElse())

0 commit comments

Comments
 (0)