ruby-changes:72992
From: S-H-GAMELINKS <ko1@a...>
Date: Sat, 20 Aug 2022 12:25:14 +0900 (JST)
Subject: [ruby-changes:72992] fc5382d465 (master): Reuse rb_class_new_instance_kw function
https://git.ruby-lang.org/ruby.git/commit/?id=fc5382d465 From fc5382d46524bdf901efc8d15ef9faf14bea3ad1 Mon Sep 17 00:00:00 2001 From: S-H-GAMELINKS <gamelinks007@g...> Date: Mon, 15 Aug 2022 19:40:45 +0900 Subject: Reuse rb_class_new_instance_kw function --- object.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/object.c b/object.c index d1743b554b..eb54d84967 100644 --- a/object.c +++ b/object.c @@ -1982,13 +1982,7 @@ rb_class_new_instance_kw(int argc, const VALUE *argv, VALUE klass, int kw_splat) https://github.com/ruby/ruby/blob/trunk/object.c#L1982 VALUE rb_class_new_instance(int argc, const VALUE *argv, VALUE klass) { - VALUE obj; - Check_Type(klass, T_CLASS); - - obj = rb_class_alloc(klass); - rb_obj_call_init_kw(obj, argc, argv, RB_NO_KEYWORDS); - - return obj; + return rb_class_new_instance_kw(argc, argv, klass, RB_NO_KEYWORDS); } /** -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/