[rubygems/rubygems] Do not replace the cache entry if there is already one
* That way, multiple lookups for the same file always return the same object. https://github.com/rubygems/rubygems/commit/50a431b6db
This commit is contained in:
parent
2453d16f5e
commit
05ae2c11fa
@ -1124,7 +1124,12 @@ class Gem::Specification < Gem::BasicSpecification
|
||||
if Gem::Specification === _spec
|
||||
_spec.loaded_from = File.expand_path file.to_s
|
||||
LOAD_CACHE_MUTEX.synchronize do
|
||||
LOAD_CACHE[file] = _spec
|
||||
prev = LOAD_CACHE[file]
|
||||
if prev
|
||||
_spec = prev
|
||||
else
|
||||
LOAD_CACHE[file] = _spec
|
||||
end
|
||||
end
|
||||
return _spec
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user