From 803295313b8fb71a30f0b63c6b2e651819cbbf7b Mon Sep 17 00:00:00 2001 From: Michael Oberegger Date: Wed, 4 Feb 2026 18:39:51 -0500 Subject: [PATCH] Optimize _map_collection --- lib/jbuilder.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/jbuilder.rb b/lib/jbuilder.rb index 1290839..d6e3867 100644 --- a/lib/jbuilder.rb +++ b/lib/jbuilder.rb @@ -344,9 +344,11 @@ def _set_value(key, value) end def _map_collection(collection) - collection.map do |element| + collection = collection.map do |element| _scope{ yield element } - end - [BLANK] + end + collection.delete(BLANK) + collection end def _scope