diff options
author | eileencodes <eileencodes@gmail.com> | 2021-03-10 10:24:28 -0500 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2021-03-10 09:39:18 -0800 |
commit | 23a48d8fe683df289736e2d90c86006eb919b40d (patch) | |
tree | cf955554a13a3bf0564f57445302455a02dec59a /class.c | |
parent | 9cdb5a51532c99230c2303912a13b9f752f1e775 (diff) |
Refactor `rb_class_ivar_set`
In every caller of `rb_class_ivar_set` it checks for the `RCLASS_IV_TBL`
and then creates it if it doesn't exist. Instead of repeating this in
every caller, this can be done once in `rb_class_ivar_set`.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4254
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 3 |
1 files changed, 0 insertions, 3 deletions
@@ -529,9 +529,6 @@ void rb_singleton_class_attached(VALUE klass, VALUE obj) { if (FL_TEST(klass, FL_SINGLETON)) { - if (!RCLASS_IV_TBL(klass)) { - RCLASS_IV_TBL(klass) = st_init_numtable(); - } rb_class_ivar_set(klass, id_attached, obj); } } |