diff options
author | Viktar Basharymau <6alliapumob@gmail.com> | 2015-11-22 18:37:30 +0300 |
---|---|---|
committer | Viktar Basharymau <6alliapumob@gmail.com> | 2015-11-22 18:37:30 +0300 |
commit | 35442422fa39b3f1db0115b6eef4b595c98e92b6 (patch) | |
tree | 0d59845ade6dc7839e98b04896fc54ab1840e3f1 /guides | |
parent | 4547e894e9f924221f1ec4ff8e71fa750bab3595 (diff) | |
download | rails-35442422fa39b3f1db0115b6eef4b595c98e92b6.tar.gz rails-35442422fa39b3f1db0115b6eef4b595c98e92b6.tar.bz2 rails-35442422fa39b3f1db0115b6eef4b595c98e92b6.zip |
Simplify `RailsGuides::Generator#select_only` a bit
The main goal is to improve readability, but as a side effect this commit makes the method a bit faster.
Diffstat (limited to 'guides')
-rw-r--r-- | guides/rails_guides/generator.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/guides/rails_guides/generator.rb b/guides/rails_guides/generator.rb index b7a94f144c..7618fce2c8 100644 --- a/guides/rails_guides/generator.rb +++ b/guides/rails_guides/generator.rb @@ -162,7 +162,7 @@ module RailsGuides def select_only(guides) prefixes = ENV['ONLY'].split(",").map(&:strip) guides.select do |guide| - prefixes.any? { |p| guide.start_with?(p) || guide.start_with?("kindle") } + guide.start_with?('kindle'.freeze, *prefixes) end end |