lib/veritas/optimizer/relation/operation/reverse.rb in veritas-optimizer-0.0.5 vs lib/veritas/optimizer/relation/operation/reverse.rb in veritas-optimizer-0.0.6
- old
+ new
@@ -47,12 +47,11 @@
#
# @return [Order]
#
# @api private
def optimize
- operand = self.operand
- operand.class.new(operand.operand, operation.directions)
+ operand.operand.sort_by { operation.directions }
end
end # class OrderOperand
# Optimize when operand is optimizable
@@ -63,10 +62,10 @@
#
# @return [Reverse]
#
# @api private
def optimize
- operation.class.new(operand)
+ operand.reverse
end
end # class UnoptimizedOperand
Veritas::Relation::Operation::Reverse.optimizer = chain(