summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAkinori MUSHA <knu@idaemons.org>2023-12-08 22:18:25 +0900
committerAkinori MUSHA <knu@idaemons.org>2023-12-23 16:50:30 +0900
commit6fc3171e8af966c680664791b05fa9d505c95d19 (patch)
treee91d1721185b9fa5f03666a586dc53362b5cef58 /lib
parent271c74a473b4fa2cdd754865882ba9912b58541c (diff)
[ruby/set] The arity of initialize_clone is -1 in Ruby >= 3
https://github.com/ruby/set/commit/32a9689696
Diffstat (limited to 'lib')
-rw-r--r--lib/set.rb16
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/set.rb b/lib/set.rb
index b4d5c5976c..485f2d5d51 100644
--- a/lib/set.rb
+++ b/lib/set.rb
@@ -286,18 +286,10 @@ 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
+ # Clone internal hash.
+ def initialize_clone(orig, **options)
+ super
+ @hash = orig.instance_variable_get(:@hash).clone(**options)
end
def freeze # :nodoc: