Class: Veritas::Optimizer::Function::Connective::Binary::RedundantRightOperand
- Inherits:
-
Veritas::Optimizer::Function::Connective::Binary
- Object
- Veritas::Optimizer
- Veritas::Optimizer::Function::Connective::Binary
- Veritas::Optimizer::Function::Connective::Binary::RedundantRightOperand
- Defined in:
- lib/veritas/optimizer/function/connective/binary.rb
Overview
Optimize when the right 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 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 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 right operand is redundant
229 230 231 232 |
# File 'lib/veritas/optimizer/function/connective/binary.rb', line 229 def optimizable? right = self.right 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
239 240 241 |
# File 'lib/veritas/optimizer/function/connective/binary.rb', line 239 def optimize right end |