lib/skylight/util/lru_cache.rb in skylight-5.0.0.beta vs lib/skylight/util/lru_cache.rb in skylight-5.0.0.beta2
- old
+ new
@@ -9,12 +9,10 @@
def max_size=(size)
raise ArgumentError, :max_size if @max_size < 1
@max_size = size
- while @data.size > @max_size
- @data.shift
- end
+ @data.shift while @data.size > @max_size
end
# Individual hash operations here are atomic in MRI.
def fetch(key)
found = true