Skip to content

Commit 3360157

Browse files
committed
removes temporary LRU hack now provided by the gem
1 parent 45b9542 commit 3360157

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

activesupport/activesupport.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ Gem::Specification.new do |s|
2525
s.add_dependency 'tzinfo', '~> 0.3.37'
2626
s.add_dependency 'minitest', '~> 4.2'
2727
s.add_dependency 'thread_safe','~> 0.1'
28-
s.add_dependency 'lru_redux'
28+
s.add_dependency 'lru_redux', '~> 0.0.6'
2929
end

activesupport/lib/active_support/inflector/memoization.rb

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22

33
require 'lru_redux'
44

5-
LruRedux::Cache.class_eval do
6-
def fetch(key)
7-
self[key] = yield unless @data.key?(key)
8-
self[key]
9-
end
10-
end
11-
125
module ActiveSupport
136
module Inflector
147
LRU_CACHE_SIZE = 200
@@ -26,7 +19,7 @@ def self.memoize(method_name)
2619

2720
# Note that so far no method in the inflector gets a block.
2821
define_method(method_name) do |*args|
29-
cache.fetch(args) do
22+
cache.getset(args) do
3023
send("#{method_name}_without_lru_cache", *args)
3124
end
3225
end

0 commit comments

Comments
 (0)