We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d3caef9 commit bdbd841Copy full SHA for bdbd841
lib/puppet/settings.rb
@@ -146,8 +146,8 @@ def initialize
146
@configuration_file = nil
147
148
# And keep a per-environment cache
149
- @cache = Concurrent::Hash.new { |hash, key| hash[key] = Concurrent::Hash.new }
150
- @values = Concurrent::Hash.new { |hash, key| hash[key] = Concurrent::Hash.new }
+ @cache = Concurrent::Hash.new { |hash, key| hash.compute_if_absent(key) { Concurrent::Hash.new } }
+ @values = Concurrent::Hash.new { |hash, key| hash.compute_if_absent(key) { Concurrent::Hash.new } }
151
152
# The list of sections we've used.
153
@used = []
0 commit comments