Incorporate code review feedback

This commit is contained in:
Alexander Köplinger 2014-11-30 14:30:22 +01:00
parent 98405edf61
commit a0da18e4f8
1 changed files with 4 additions and 7 deletions

View File

@ -95,13 +95,10 @@ module Jekyll
end
def collect_urls_case_insensitive(urls, things, destination)
things.each do |thing|
dest = thing.destination(destination)
if urls[dest.downcase]
urls[dest.downcase] << dest
else
urls[dest.downcase] = [dest]
end
things.inject(urls) do |memo, thing|
dest = thing.destination(destination)
(memo[dest.downcase] ||= []) << dest
memo
end
urls
end