Class: Axiom::Optimizer::Function::Connective::Binary::RedundantRight
- Inherits:
-
Axiom::Optimizer::Function::Connective::Binary
- Object
- Axiom::Optimizer
- Axiom::Optimizer::Function::Connective::Binary
- Axiom::Optimizer::Function::Connective::Binary::RedundantRight
- Defined in:
- lib/axiom/optimizer/function/connective/binary.rb
Overview
Optimize when the right 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 right operand is redundant.
-
#optimize ⇒ Function
private
A Binary connective with a redundant right operand is equivalent to the right.
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 right operand is redundant
222 223 224 |
# File 'lib/axiom/optimizer/function/connective/binary.rb', line 222 def optimizable? operation.kind_of?(right.class) && left.eql?(right.left) 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 right operand is equivalent to the right
231 232 233 |
# File 'lib/axiom/optimizer/function/connective/binary.rb', line 231 def optimize right end |