ruby-changes:64311
From: Nobuyoshi <ko1@a...>
Date: Sat, 19 Dec 2020 11:54:31 +0900 (JST)
Subject: [ruby-changes:64311] 34f6b22df0 (master): Use rb_id_attrset without intermediate strings
https://git.ruby-lang.org/ruby.git/commit/?id=34f6b22df0 From 34f6b22df073fe86e30aca99be5aa0b0eb8653df Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 18 Dec 2020 12:10:20 +0900 Subject: Use rb_id_attrset without intermediate strings diff --git a/object.c b/object.c index b532dd3..8626d5c 100644 --- a/object.c +++ b/object.c @@ -2306,7 +2306,7 @@ rb_mod_attr(int argc, VALUE *argv, VALUE klass) https://github.com/ruby/ruby/blob/trunk/object.c#L2306 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); -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/