Class: Veritas::Optimizer::Function::Connective::Binary::RedundantLeftOperand
- Inherits:
-
Veritas::Optimizer::Function::Connective::Binary
- Object
- Veritas::Optimizer
- Veritas::Optimizer::Function::Connective::Binary
- Veritas::Optimizer::Function::Connective::Binary::RedundantLeftOperand
- Defined in:
- lib/veritas/optimizer/function/connective/binary.rb
Overview
Optimize when the left operand is redundant
Constant Summary
Constants inherited from Veritas::Optimizer
Instance Attribute Summary
Attributes included from Binary
Attributes inherited from Veritas::Optimizer
Instance Method Summary collapse
-
#optimizable? ⇒ Boolean
private
Test if the left operand is redundant.
-
#optimize ⇒ Function
private
A Binary connective with a redundant left operand is equivalent to the left.
Methods included from Binary
Methods inherited from Veritas::Optimizer
Instance Method Details
#optimizable? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Test if the left operand is redundant
205 206 207 208 |
# File 'lib/veritas/optimizer/function/connective/binary.rb', line 205 def optimizable? left = self.left operation.kind_of?(left.class) && right.eql?(left.right) end |
#optimize ⇒ Function
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
A Binary connective with a redundant left operand is equivalent to the left
215 216 217 |
# File 'lib/veritas/optimizer/function/connective/binary.rb', line 215 def optimize left end |