summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2025-07-01 10:28:44 +0200
committerJean Boussier <jean.boussier@gmail.com>2025-07-01 12:39:23 +0200
commitad65d53aa4d241359df183afd3756653cc1571f9 (patch)
tree5d630bcf9cc7c30b016aded921224c1685606df3 /class.c
parentd3d249b9048b338535ae033acb3606abf174b2da (diff)
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.
Diffstat (limited to 'class.c')
-rw-r--r--class.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/class.c b/class.c
index 96e9aaed21..bef54eae2f 100644
--- a/class.c
+++ b/class.c
@@ -980,20 +980,15 @@ copy_tables(VALUE clone, VALUE orig)
rb_id_table_free(RCLASS_M_TBL(clone));
RCLASS_WRITE_M_TBL_EVEN_WHEN_PROMOTED(clone, 0);
if (!RB_TYPE_P(clone, T_ICLASS)) {
- st_data_t id;
-
rb_fields_tbl_copy(clone, orig);
- CONST_ID(id, "__tmp_classpath__");
- rb_attr_delete(clone, id);
- CONST_ID(id, "__classpath__");
- rb_attr_delete(clone, id);
}
if (RCLASS_CONST_TBL(orig)) {
struct clone_const_arg arg;
struct rb_id_table *const_tbl;
- arg.tbl = const_tbl = rb_id_table_create(0);
+ struct rb_id_table *orig_tbl = RCLASS_CONST_TBL(orig);
+ arg.tbl = const_tbl = rb_id_table_create(rb_id_table_size(orig_tbl));
arg.klass = clone;
- rb_id_table_foreach(RCLASS_CONST_TBL(orig), clone_const_i, &arg);
+ rb_id_table_foreach(orig_tbl, clone_const_i, &arg);
RCLASS_WRITE_CONST_TBL(clone, const_tbl, false);
}
}