summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-12-18 12:10:20 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-12-19 11:44:05 +0900
commit34f6b22df073fe86e30aca99be5aa0b0eb8653df (patch)
tree1dcfee3fabca69408bd8b0b92375ce01364265c7 /object.c
parent5616f2ee93e63e575dc5e30db75a6f475ac57fb3 (diff)
Use rb_id_attrset without intermediate strings
Diffstat (limited to 'object.c')
-rw-r--r--object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/object.c b/object.c
index b532dd3a84..8626d5c6b7 100644
--- a/object.c
+++ b/object.c
@@ -2306,7 +2306,7 @@ rb_mod_attr(int argc, VALUE *argv, VALUE klass)
rb_category_warning(RB_WARN_CATEGORY_DEPRECATED, "optional boolean argument is obsoleted");
rb_attr(klass, id, 1, RTEST(argv[1]), TRUE);
rb_ary_push(names, ID2SYM(id));
- if (argv[1] == Qtrue) rb_ary_push(names, rb_str_intern(rb_sprintf("%"PRIsVALUE"=", ID2SYM(id))));
+ if (argv[1] == Qtrue) rb_ary_push(names, ID2SYM(rb_id_attrset(id)));
return names;
}
return rb_mod_attr_reader(argc, argv, klass);