mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fix SortedSet subclasses that override initialize
The first time SortedSet#initialize is called, it overwrites itself, then recalls #initialize, which results in calling the subclass's initialize, not the current initialize. Just inline the default initialize behavior to avoid this issue. No test for this as it can only be triggered the very first time that SortedSet#initialize is called. Fixes [Bug #15830]
This commit is contained in:
parent
2d076dd5ac
commit
258843106f
1 changed files with 2 additions and 1 deletions
|
@ -804,7 +804,8 @@ class SortedSet < Set
|
|||
|
||||
def initialize(*args, &block) # :nodoc:
|
||||
SortedSet.setup
|
||||
initialize(*args, &block)
|
||||
@keys = nil
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue