diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-01-31 14:44:04 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-01-31 14:44:04 -0800 |
commit | 8da52b13b5a565d4c41c3e3b3f2562f3f1852a56 (patch) | |
tree | bd815154ee1dc63719b6e5f50a6aaae6cd5c56d5 /activesupport/lib/active_support | |
parent | 85750f22c90c914a429116fb908990c5a2c68379 (diff) | |
download | rails-8da52b13b5a565d4c41c3e3b3f2562f3f1852a56.tar.gz rails-8da52b13b5a565d4c41c3e3b3f2562f3f1852a56.tar.bz2 rails-8da52b13b5a565d4c41c3e3b3f2562f3f1852a56.zip |
Remove duplicate ConcurrentHash
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/memoizable.rb | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/activesupport/lib/active_support/memoizable.rb b/activesupport/lib/active_support/memoizable.rb index 8e9abeaf91..bd9dbb60fc 100644 --- a/activesupport/lib/active_support/memoizable.rb +++ b/activesupport/lib/active_support/memoizable.rb @@ -1,29 +1,4 @@ module ActiveSupport - class ConcurrentHash - def initialize(hash = {}) - @backup_cache = hash.dup - @frozen_cache = hash.dup.freeze - @mutex = Mutex.new - end - - def []=(k,v) - @mutex.synchronize { @backup_cache[k] = v } - @frozen_cache = @backup_cache.dup.freeze - end - - def [](k) - if @frozen_cache.key?(k) - @frozen_cache[k] - else - @mutex.synchronize { @backup_cache[k] } - end - end - - def empty? - @backup_cache.empty? - end - end - module SafelyMemoizable def safely_memoize(*symbols) symbols.each do |symbol| |