Skip to content

Commit 3733cb9

Browse files
committed
class.c: Stop deleting __classpath__ / __tmp_classpath__
These used to be private variables to store the class name but aren't a thing since several versions.
1 parent ce6e612 commit 3733cb9

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

class.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -980,20 +980,15 @@ copy_tables(VALUE clone, VALUE orig)
980980
rb_id_table_free(RCLASS_M_TBL(clone));
981981
RCLASS_WRITE_M_TBL_EVEN_WHEN_PROMOTED(clone, 0);
982982
if (!RB_TYPE_P(clone, T_ICLASS)) {
983-
st_data_t id;
984-
985983
rb_fields_tbl_copy(clone, orig);
986-
CONST_ID(id, "__tmp_classpath__");
987-
rb_attr_delete(clone, id);
988-
CONST_ID(id, "__classpath__");
989-
rb_attr_delete(clone, id);
990984
}
991985
if (RCLASS_CONST_TBL(orig)) {
992986
struct clone_const_arg arg;
993987
struct rb_id_table *const_tbl;
994-
arg.tbl = const_tbl = rb_id_table_create(0);
988+
struct rb_id_table *orig_tbl = RCLASS_CONST_TBL(orig);
989+
arg.tbl = const_tbl = rb_id_table_create(rb_id_table_size(orig_tbl));
995990
arg.klass = clone;
996-
rb_id_table_foreach(RCLASS_CONST_TBL(orig), clone_const_i, &arg);
991+
rb_id_table_foreach(orig_tbl, clone_const_i, &arg);
997992
RCLASS_WRITE_CONST_TBL(clone, const_tbl, false);
998993
}
999994
}

0 commit comments

Comments
 (0)