module Axiom::Optimizer::Function::Predicate::Enumerable::EmptyRight

Optimize when the right operand is empty

Public Instance Methods

optimizable?() click to toggle source

Test if the right operand is empty

@return [Boolean]

@api private

# File lib/axiom/optimizer/function/predicate/enumerable.rb, line 89
def optimizable?
  right_nil? || right_none?
end

Private Instance Methods

right_nil?() click to toggle source

Test if the right operand is nil

@return [Boolean]

@api private

# File lib/axiom/optimizer/function/predicate/enumerable.rb, line 100
def right_nil?
  right.nil?
end
right_none?() click to toggle source

Test if the right operand has no entries

@return [Boolean]

@api private

# File lib/axiom/optimizer/function/predicate/enumerable.rb, line 109
def right_none?
  right.none? { true }
end