Skip to content

Commit

Permalink
Perf for scan pt 1
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzedge committed Dec 25, 2016
1 parent 97ecd36 commit 3e2a03c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rambling/trie/container.rb
Expand Up @@ -65,7 +65,7 @@ def word? word = ''
# @param [String] word the word to look for in the trie.
# @return [Array] all the words contained in the trie that start with the specified characters.
def scan word = ''
root.scan word.chars.to_a
root.scan(word.chars).to_a
end

alias_method :include?, :word?
Expand Down
2 changes: 1 addition & 1 deletion lib/rambling/trie/raw_node.rb
Expand Up @@ -45,7 +45,7 @@ def word? chars = []
# @param [Array] chars the characters to look for in the trie.
# @return [Array] all the words contained in the trie that start with the specified characters.
def scan chars
closest_node(chars).to_a
closest_node chars
end

# Always return `false` for a raw (uncompressed) node.
Expand Down

0 comments on commit 3e2a03c

Please sign in to comment.