File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
test/query-tests/Expressions/RedundantExpression Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,10 @@ class RedundantIdemnecantOperand extends RedundantOperand {
64
64
* arguments to integers. For example, `x&x` is a common idiom for converting `x` to an integer.
65
65
*/
66
66
class RedundantIdempotentOperand extends RedundantOperand {
67
- RedundantIdempotentOperand ( ) { getParent ( ) instanceof LogicalBinaryExpr }
67
+ RedundantIdempotentOperand ( ) {
68
+ getParent ( ) instanceof LogicalBinaryExpr and
69
+ not exists ( UpdateExpr e | e .getParentExpr + ( ) = this )
70
+ }
68
71
}
69
72
70
73
/**
Original file line number Diff line number Diff line change @@ -6,4 +6,6 @@ x == 23 || x == 23;
6
6
x & x ;
7
7
8
8
// this may actually be OK, but it's not good style
9
- pop ( ) && pop ( ) ;
9
+ pop ( ) && pop ( ) ;
10
+
11
+ foo [ bar ++ ] && foo [ bar ++ ] // OK
You can’t perform that action at this time.
0 commit comments