From d17d13c806f7833f4ab19da911f54a0e0704da5c Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 30 Mar 2022 18:03:11 +0100 Subject: [PATCH 1/1] Use map rather than foo = [] ... each ... foo.push(bar) --- lib/osm_community_index/local_chapter.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/osm_community_index/local_chapter.rb b/lib/osm_community_index/local_chapter.rb index 6df3c1bc9..f36a6441c 100644 --- a/lib/osm_community_index/local_chapter.rb +++ b/lib/osm_community_index/local_chapter.rb @@ -13,13 +13,11 @@ module OsmCommunityIndex def self.init_local_chapters raw_local_chapters = load_raw_local_chapters - local_chapters = [] - raw_local_chapters.each do |chapter| + raw_local_chapters.map do |chapter| id = chapter[:id] url = chapter[:resource]["strings"]["url"] - local_chapters.push(LocalChapter.new(id, url)) + LocalChapter.new(id, url) end - local_chapters end def self.load_raw_local_chapters -- 2.45.2