Skip to content

Commit 58283a0

Browse files
authored
Merge pull request #612 from affinity/moberegger/optimize-_map_collection
2 parents 09ca3e1 + 8032953 commit 58283a0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎lib/jbuilder.rb‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,11 @@ def _set_value(key, value)
356356
end
357357

358358
def _map_collection(collection)
359-
collection.map do |element|
359+
collection = collection.map do |element|
360360
_scope{ yield element }
361-
end - [BLANK]
361+
end
362+
collection.delete(BLANK)
363+
collection
362364
end
363365

364366
def _scope

0 commit comments

Comments
 (0)