Skip to content

Commit 382550c

Browse files
committed
Flattne the condition
1 parent aa83e25 commit 382550c

File tree

1 file changed

+6
-9
lines changed
  • lib/concurrent-ruby/concurrent

1 file changed

+6
-9
lines changed

lib/concurrent-ruby/concurrent/map.rb

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@ module Collection
1515
when Concurrent.on_cruby?
1616
require 'concurrent/collection/map/mri_map_backend'
1717
MriMapBackend
18-
when Concurrent.on_rbx? || Concurrent.on_truffleruby?
19-
if defined?(::TruffleRuby::ConcurrentMap)
20-
require 'concurrent/collection/map/truffleruby_map_backend'
21-
TruffleRubyMapBackend
22-
else
23-
require 'concurrent/collection/map/atomic_reference_map_backend'
24-
AtomicReferenceMapBackend
25-
end
18+
when Concurrent.on_truffleruby? && defined?(::TruffleRuby::ConcurrentMap)
19+
require 'concurrent/collection/map/truffleruby_map_backend'
20+
TruffleRubyMapBackend
21+
when Concurrent.on_truffleruby? || Concurrent.on_rbx?
22+
require 'concurrent/collection/map/atomic_reference_map_backend'
23+
AtomicReferenceMapBackend
2624
else
2725
warn 'Concurrent::Map: unsupported Ruby engine, using a fully synchronized Concurrent::Map implementation'
2826
require 'concurrent/collection/map/synchronized_map_backend'
@@ -119,7 +117,6 @@ class Map < Collection::MapImplementation
119117
# @return [true, false] true if deleted
120118
# @!macro map.atomic_method
121119

122-
123120
def initialize(options = nil, &block)
124121
if options.kind_of?(::Hash)
125122
validate_options_hash!(options)

0 commit comments

Comments
 (0)