Merged common statements [Bug #16242]
This commit is contained in:
parent
f0a5a07fa5
commit
2fa3b4565a
8
class.c
8
class.c
@ -825,20 +825,14 @@ VALUE
|
|||||||
rb_include_class_new(VALUE module, VALUE super)
|
rb_include_class_new(VALUE module, VALUE super)
|
||||||
{
|
{
|
||||||
VALUE klass = class_alloc(T_ICLASS, rb_cClass);
|
VALUE klass = class_alloc(T_ICLASS, rb_cClass);
|
||||||
RCLASS_SET_ORIGIN(klass, klass);
|
|
||||||
|
|
||||||
RCLASS_M_TBL(OBJ_WB_UNPROTECT(klass)) =
|
RCLASS_M_TBL(OBJ_WB_UNPROTECT(klass)) =
|
||||||
RCLASS_M_TBL(OBJ_WB_UNPROTECT(module)); /* TODO: unprotected? */
|
RCLASS_M_TBL(OBJ_WB_UNPROTECT(module)); /* TODO: unprotected? */
|
||||||
|
|
||||||
|
RCLASS_SET_ORIGIN(klass, module == RCLASS_ORIGIN(module) ? klass : RCLASS_ORIGIN(module));
|
||||||
if (BUILTIN_TYPE(module) == T_ICLASS) {
|
if (BUILTIN_TYPE(module) == T_ICLASS) {
|
||||||
if (module != RCLASS_ORIGIN(module)) {
|
|
||||||
RCLASS_SET_ORIGIN(klass, RCLASS_ORIGIN(module));
|
|
||||||
}
|
|
||||||
module = RBASIC(module)->klass;
|
module = RBASIC(module)->klass;
|
||||||
}
|
}
|
||||||
else if (module != RCLASS_ORIGIN(module)) {
|
|
||||||
RCLASS_SET_ORIGIN(klass, RCLASS_ORIGIN(module));
|
|
||||||
}
|
|
||||||
if (!RCLASS_IV_TBL(module)) {
|
if (!RCLASS_IV_TBL(module)) {
|
||||||
RCLASS_IV_TBL(module) = st_init_numtable();
|
RCLASS_IV_TBL(module) = st_init_numtable();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user