Method: Bmg::Operator::NotMatching#each

Defined in:
lib/bmg/operator/not_matching.rb

#eachObject



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/bmg/operator/not_matching.rb', line 25

def each
  return to_enum unless block_given?
  index = Hash.new
  right.each_with_object(index) do |t, index|
    key = tuple_project(t, on)
    index[key] = true
  end
  left.each do |tuple|
    key = tuple_project(tuple, on)
    yield tuple unless index.has_key?(key)
  end
end