DescendantsTracker: fix a method redefinition warning
This commit is contained in:
parent
837f20e430
commit
b205dc4b36
@ -95,11 +95,6 @@ def reject!(classes) # :nodoc:
|
||||
end
|
||||
end
|
||||
|
||||
def descendants
|
||||
subclasses = self.subclasses
|
||||
subclasses.concat(subclasses.flat_map(&:descendants))
|
||||
end
|
||||
|
||||
if RubyFeatures::CLASS_SUBCLASSES
|
||||
class << self
|
||||
def subclasses(klass)
|
||||
@ -110,6 +105,11 @@ def descendants(klass)
|
||||
klass.descendants
|
||||
end
|
||||
end
|
||||
|
||||
def descendants
|
||||
subclasses = self.subclasses
|
||||
subclasses.concat(subclasses.flat_map(&:descendants))
|
||||
end
|
||||
else
|
||||
# DescendantsArray is an array that contains weak references to classes.
|
||||
# Note: DescendantsArray is redundant with WeakSet, however WeakSet when used
|
||||
|
Loading…
Reference in New Issue
Block a user