]> git.openstreetmap.org Git - rails.git/commitdiff
Use map rather than foo = [] ... each ... foo.push(bar)
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 30 Mar 2022 17:03:11 +0000 (18:03 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 30 Mar 2022 17:03:11 +0000 (18:03 +0100)
lib/osm_community_index/local_chapter.rb

index 6df3c1bc9edcd37340c33c994c6c3bf2b9bc969e..f36a6441cd0748419c9bdefa82c98eab29d38e77 100644 (file)
@@ -13,13 +13,11 @@ module OsmCommunityIndex
 
     def self.init_local_chapters
       raw_local_chapters = load_raw_local_chapters
 
     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"]
         id = chapter[:id]
         url = chapter[:resource]["strings"]["url"]
-        local_chapters.push(LocalChapter.new(id, url))
+        LocalChapter.new(id, url)
       end
       end
-      local_chapters
     end
 
     def self.load_raw_local_chapters
     end
 
     def self.load_raw_local_chapters