From 35442422fa39b3f1db0115b6eef4b595c98e92b6 Mon Sep 17 00:00:00 2001 From: Viktar Basharymau <6alliapumob@gmail.com> Date: Sun, 22 Nov 2015 18:37:30 +0300 Subject: 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. --- guides/rails_guides/generator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') 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 -- cgit v1.2.3