lib/dry/events/constants.rb in dry-events-1.0.0 vs lib/dry/events/constants.rb in dry-events-1.0.1
- old
+ new
@@ -4,8 +4,10 @@
module Dry
module Events
include Dry::Core::Constants
- LISTENERS_HASH = Concurrent::Map.new { |h, k| h[k] = [] }
+ LISTENERS_HASH = Concurrent::Map.new do |h, k|
+ h.compute_if_absent(k) { [] }
+ end
end
end