isNegationOf returns true when b is the logical negation of a or a is the logical negation of b (handles both A / !A and !A / A cases).
(a, b ConditionNode)
| 113 | // isNegationOf returns true when b is the logical negation of a or a is the |
| 114 | // logical negation of b (handles both A / !A and !A / A cases). |
| 115 | func isNegationOf(a, b ConditionNode) bool { |
| 116 | if notB, ok := b.(*NotNode); ok && nodesEqual(a, notB.Child) { |
| 117 | return true |
| 118 | } |
| 119 | if notA, ok := a.(*NotNode); ok && nodesEqual(notA.Child, b) { |
| 120 | return true |
| 121 | } |
| 122 | return false |
| 123 | } |
| 124 | |
| 125 | // containsStatusFunc returns true when any node in the tree is a status function. |
| 126 | // Used to gate complement / idempotent rules that must not fire on expressions |