lib/rambling/trie/enumerable.rb in rambling-trie-0.5.2 vs lib/rambling/trie/enumerable.rb in rambling-trie-0.6.0
- old
+ new
@@ -8,10 +8,10 @@
# Calls block once for each of the words contained in the trie. If no block given, an Enumerator is returned.
def each(&block)
enumerator = Enumerator.new do |words|
words << as_word if terminal?
- children.each { |key, child| child.each { |word| words << word } }
+ children.each { |child| child.each { |word| words << word } }
end
block.nil? ? enumerator : enumerator.each(&block)
end
end