diff options
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/weak_hash.rb | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/activesupport/lib/active_support/weak_hash.rb b/activesupport/lib/active_support/weak_hash.rb index 171e38f9d8..d6096e606e 100644 --- a/activesupport/lib/active_support/weak_hash.rb +++ b/activesupport/lib/active_support/weak_hash.rb @@ -22,16 +22,9 @@ module ActiveSupport end def []=(key, value) - key2 = case key - when Fixnum, Symbol, true, false, nil - key - else - key.dup - end - - @rev_cache[value.object_id][key2] = true - @cache[key2] = value.object_id - @key_map[key.object_id] = key2 + @rev_cache[value.object_id][key] = true + @cache[key] = value.object_id + @key_map[key.object_id] = key ObjectSpace.define_finalizer(value, @reclaim_value) end |