DescendantsTracker: fix a method redefinition warning

This commit is contained in:
Jean Boussier 2022-10-03 21:37:33 +02:00
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