1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Optimize DescendantsArray insertions

This commit is contained in:
Jean Boussier 2019-07-25 11:37:39 -04:00
parent 55eba62a10
commit 62a1d7e9c1

View file

@ -77,15 +77,17 @@ module ActiveSupport
end
def <<(klass)
cleanup!
@refs << WeakRef.new(klass)
end
def each
@refs.each do |ref|
@refs.reject! do |ref|
yield ref.__getobj__
false
rescue WeakRef::RefError
true
end
self
end
def refs_size