Class: Axiom::Optimizer::Function::Connective::Binary::RedundantLeft
- Inherits:
-
Axiom::Optimizer::Function::Connective::Binary
- Object
- Axiom::Optimizer
- Axiom::Optimizer::Function::Connective::Binary
- Axiom::Optimizer::Function::Connective::Binary::RedundantLeft
- Defined in:
- lib/axiom/optimizer/function/connective/binary.rb
Overview
Optimize when the left operand is redundant
Constant Summary
Constants inherited from Axiom::Optimizer
Instance Attribute Summary
Attributes included from Binary
Attributes inherited from Axiom::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 Axiom::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
199 200 201 |
# File 'lib/axiom/optimizer/function/connective/binary.rb', line 199 def optimizable? 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
208 209 210 |
# File 'lib/axiom/optimizer/function/connective/binary.rb', line 208 def optimize left end |