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:
parent
55eba62a10
commit
62a1d7e9c1
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue