From b9c4fc93d7c3eabeaefb9d5fe1ec15453126a164 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 22 Oct 2014 00:57:06 -0700 Subject: [PATCH] Use flat_map instead of map.flatten --- lib/jekyll/cleaner.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/cleaner.rb b/lib/jekyll/cleaner.rb index 0aa3cdfd..c578c9b8 100644 --- a/lib/jekyll/cleaner.rb +++ b/lib/jekyll/cleaner.rb @@ -49,7 +49,7 @@ module Jekyll # # Returns a Set with the directory paths def new_dirs - new_files.map { |file| parent_dirs(file) }.flatten.to_set + new_files.flat_map { |file| parent_dirs(file) }.to_set end # Private: The list of parent directories of a given file @@ -76,7 +76,7 @@ module Jekyll # # Returns a Set with the directory paths def keep_dirs - site.keep_files.map{|file| parent_dirs(File.join(site.dest, file))}.flatten.to_set + site.keep_files.flat_map { |file| parent_dirs(File.join(site.dest, file)) }.to_set end # Private: Creates a regular expression from the config's keep_files array