mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 12:14:51 +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
27d6c96658
commit
966dbba8db
Notes:
git
2025-12-30 13:32:18 +00:00
2
class.c
2
class.c
@ -820,7 +820,7 @@ class_alloc0(enum ruby_value_type type, VALUE klass, bool boxable)
|
|||||||
static VALUE
|
static VALUE
|
||||||
class_alloc(enum ruby_value_type type, VALUE klass)
|
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);
|
return class_alloc0(type, klass, boxable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user