зеркало из https://github.com/github/ruby.git
[ruby/set] The arity of initialize_clone is -1 in Ruby >= 3
https://github.com/ruby/set/commit/32a9689696
This commit is contained in:
Родитель
271c74a473
Коммит
6fc3171e8a
|
@ -286,19 +286,11 @@ class Set
|
|||
@hash = orig.instance_variable_get(:@hash).dup
|
||||
end
|
||||
|
||||
if Kernel.instance_method(:initialize_clone).arity != 1
|
||||
# Clone internal hash.
|
||||
def initialize_clone(orig, **options)
|
||||
super
|
||||
@hash = orig.instance_variable_get(:@hash).clone(**options)
|
||||
end
|
||||
else
|
||||
# Clone internal hash.
|
||||
def initialize_clone(orig)
|
||||
super
|
||||
@hash = orig.instance_variable_get(:@hash).clone
|
||||
end
|
||||
end
|
||||
|
||||
def freeze # :nodoc:
|
||||
@hash.freeze
|
||||
|
|
Загрузка…
Ссылка в новой задаче