Skip to content

Commit eb303ad

Browse files
Merge pull request rails#46536 from mensfeld/patch-2
Make sure that concurrent map usage is thread-safe
2 parents 2497eb0 + 9a77b0f commit eb303ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

actionview/lib/action_view/renderer/abstract_renderer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def render
3131

3232
module ObjectRendering # :nodoc:
3333
PREFIXED_PARTIAL_NAMES = Concurrent::Map.new do |h, k|
34-
h[k] = Concurrent::Map.new
34+
h.compute_if_absent(k) { Concurrent::Map.new }
3535
end
3636

3737
def initialize(lookup_context, options)

0 commit comments

Comments
 (0)