mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Encapsulate RCLASS_ATTACHED_OBJECT
Right now the attached object is stored as an instance variable and all the call sites that either get or set it have to know how it's stored. It's preferable to hide this implementation detail behind accessors so that it is easier to change how it's stored.
This commit is contained in:
parent
bac4d2eefa
commit
7413079dae
Notes:
git
2023-02-15 14:24:43 +00:00
13 changed files with 44 additions and 29 deletions
2
eval.c
2
eval.c
|
@ -441,7 +441,7 @@ rb_class_modify_check(VALUE klass)
|
|||
|
||||
if (FL_TEST(klass, FL_SINGLETON)) {
|
||||
desc = "object";
|
||||
klass = rb_ivar_get(klass, id__attached__);
|
||||
klass = RCLASS_ATTACHED_OBJECT(klass);
|
||||
if (!SPECIAL_CONST_P(klass)) {
|
||||
switch (BUILTIN_TYPE(klass)) {
|
||||
case T_MODULE:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue