remove FP for js/redundant-operation

This commit is contained in:
Erik Krogh Kristensen
2020-03-09 13:17:37 +01:00
parent 38581663a4
commit e88dac3dea
2 changed files with 7 additions and 2 deletions

View File

@@ -64,7 +64,10 @@ class RedundantIdemnecantOperand extends RedundantOperand {
* arguments to integers. For example, `x&x` is a common idiom for converting `x` to an integer.
*/
class RedundantIdempotentOperand extends RedundantOperand {
RedundantIdempotentOperand() { getParent() instanceof LogicalBinaryExpr }
RedundantIdempotentOperand() {
getParent() instanceof LogicalBinaryExpr and
not exists(UpdateExpr e | e.getParentExpr+() = this)
}
}
/**