Skip to content

Commit 6fd8da7

Browse files
authored
Merge pull request #879 from mtsmfm/consider-falsy-in-compute-if-absent
Consider falsy value on `Concurrent::Map#compute_if_absent` fast non-blocking path
2 parents d9efb08 + e3ceb30 commit 6fd8da7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def []=(key, value)
1919
end
2020

2121
def compute_if_absent(key)
22-
if stored_value = _get(key) # fast non-blocking path for the most likely case
22+
if NULL != (stored_value = @backend.fetch(key, NULL)) # fast non-blocking path for the most likely case
2323
stored_value
2424
else
2525
@write_lock.synchronize { super }

0 commit comments

Comments
 (0)