lib/alf/operator/relational/restrict.rb in alf-0.10.1 vs lib/alf/operator/relational/restrict.rb in alf-0.11.0
- old
+ new
@@ -1,20 +1,18 @@
module Alf
- module Operator::Relational
- class Restrict < Alf::Operator()
- include Operator::Relational, Operator::Unary
-
- signature do |s|
- s.argument :predicate, TuplePredicate, "true"
- end
-
- protected
-
- # (see Operator#_each)
- def _each
- handle = TupleHandle.new
- each_input_tuple{|t| yield(t) if @predicate.evaluate(handle.set(t)) }
- end
-
- end # class Restrict
- end # module Operator::Relational
+ module Operator
+ module Relational
+ class Restrict
+ include Relational, Unary
+
+ signature do |s|
+ s.argument :predicate, TuplePredicate, "true"
+ end
+
+ def compile
+ Engine::Filter.new(operand, predicate)
+ end
+
+ end # class Restrict
+ end # module Relational
+ end # module Operator
end # module Alf