summaryrefslogtreecommitdiff
path: root/lib/bundler/settings.rb
diff options
context:
space:
mode:
authorJosh Nichols <josh.nichols@gusto.com>2023-08-16 14:59:17 -0400
committergit <svn-admin@ruby-lang.org>2023-08-20 09:06:01 +0000
commit79b187a45ecc0f99af97631a1771092874344092 (patch)
tree0e2d15d5fc70b38cf2f94d6a51e91c8c0c2068b2 /lib/bundler/settings.rb
parent921c2bba4e4f0bb89d9ff354c05a176174586064 (diff)
[rubygems/rubygems] config is a new Hash, and config.values is a new Array. that means we can use bang methods to avoid allocating new copies
https://github.com/rubygems/rubygems/commit/8bc13fa55f
Diffstat (limited to 'lib/bundler/settings.rb')
-rw-r--r--lib/bundler/settings.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb
index 2af9b0326b..c12d1d4f74 100644
--- a/lib/bundler/settings.rb
+++ b/lib/bundler/settings.rb
@@ -99,7 +99,11 @@ module Bundler
def [](name)
key = key_for(name)
- value = configs.values.map {|config| config[key] }.compact.first
+
+ values = configs.values
+ values.map! {|config| config[key] }
+ values.compact!
+ value = values.first
converted_value(value, name)
end