Skip to content

Commit

Permalink
Don't bother collecting more phrases once we have enough
Browse files Browse the repository at this point in the history
  • Loading branch information
kerryb committed Jul 15, 2009
1 parent 8be9301 commit b224160
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions 1.rb
Expand Up @@ -9,6 +9,7 @@ def phrases(number)
words = split
all_strings = words
(2..words.size).each do |number_of_words|
break if all_strings.length >= number
all_strings += extract_phrases(words, number_of_words)
end
all_strings[0, number].map {|s| "'#{s}'"}.join(', ')
Expand Down

0 comments on commit b224160

Please sign in to comment.