mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-31 01:38:24 -05:00
Use flat_map instead of map.flatten
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user