mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 12:34:21 +00:00
Box: skip checking the current box is the root box
Because checking the current box is not a cheap process.
This commit is contained in:
parent
b3371c6ae5
commit
9b2ff68f17
2
class.c
2
class.c
@ -820,7 +820,7 @@ class_alloc0(enum ruby_value_type type, VALUE klass, bool boxable)
|
||||
static VALUE
|
||||
class_alloc(enum ruby_value_type type, VALUE klass)
|
||||
{
|
||||
bool boxable = BOX_ROOT_P(rb_current_box());
|
||||
bool boxable = rb_box_available() && BOX_ROOT_P(rb_current_box());
|
||||
return class_alloc0(type, klass, boxable);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user