mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Revert "Revert "Use rb_id_attrset without intermediate strings""
This reverts commit41c208d4a4
. Reintroduce66090b9d10
.
This commit is contained in:
parent
346bf0f5a5
commit
aa7a020710
1 changed files with 3 additions and 4 deletions
7
object.c
7
object.c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue