Permalink
Browse files

Always initialize @default and @default_block for AbstractThreadLocalVar

This avoids Ruby warnings like this when accessing the default value:

> lib/concurrent/atomic/abstract_thread_local_var.rb:57: warning: instance variable @default_block not initialized
  • Loading branch information...
1 parent 2a8a589 commit 0d5a11bfc89ffd3ff7f12ba0b4ef04bb572f75d7 @meineerde meineerde committed Feb 7, 2017
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/concurrent/atomic/abstract_thread_local_var.rb
@@ -15,7 +15,9 @@ def initialize(default = nil, &default_block)
if block_given?
@default_block = default_block
+ @default = nil
else
+ @default_block = nil
@default = default
end

0 comments on commit 0d5a11b

Please sign in to comment.