diff options
author | Yusuke Endoh <[email protected]> | 2020-12-19 03:20:09 +0900 |
---|---|---|
committer | Yusuke Endoh <[email protected]> | 2020-12-19 03:20:09 +0900 |
commit | aa7a02071072b5b0dd15357740d0ffd506bb0381 (patch) | |
tree | dd300e7ef603987a0f31f601eee916038f3f9e62 /object.c | |
parent | 346bf0f5a586ce6140e28aca145e5b6a8160ee4f (diff) |
Revert "Revert "Use rb_id_attrset without intermediate strings""
This reverts commit 41c208d4a463183fddca250026e5f1cd759d2604.
Reintroduce 66090b9d10cdaed917b525225e59d1c19e399248.
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -2332,7 +2332,7 @@ rb_mod_attr_writer(int argc, VALUE *argv, VALUE klass) for (i=0; i<argc; i++) { ID id = id_for_attr(klass, argv[i]); rb_attr(klass, id, FALSE, TRUE, TRUE); - rb_ary_push(names, rb_str_intern(rb_sprintf("%"PRIsVALUE"=", ID2SYM(id)))); + rb_ary_push(names, ID2SYM(rb_id_attrset(id))); } return names; } @@ -2363,11 +2363,10 @@ rb_mod_attr_accessor(int argc, VALUE *argv, VALUE klass) for (i=0; i<argc; i++) { ID id = id_for_attr(klass, argv[i]); - VALUE idv = ID2SYM(id); rb_attr(klass, id, TRUE, TRUE, TRUE); - rb_ary_push(names, idv); - rb_ary_push(names, rb_str_intern(rb_sprintf("%"PRIsVALUE"=", idv))); + rb_ary_push(names, ID2SYM(id)); + rb_ary_push(names, ID2SYM(rb_id_attrset(id))); } return names; } |