ruby-changes:36659
From: nobu <ko1@a...>
Date: Mon, 8 Dec 2014 13:18:15 +0900 (JST)
Subject: [ruby-changes:36659] nobu:r48740 (trunk): struct.c: trivial optimization
nobu 2014-12-08 13:18:01 +0900 (Mon, 08 Dec 2014) New Revision: 48740 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48740 Log: struct.c: trivial optimization * struct.c (rb_struct_set): get rid of calling rb_frame_this_func twice. Modified files: trunk/struct.c Index: struct.c =================================================================== --- struct.c (revision 48739) +++ struct.c (revision 48740) @@ -150,12 +150,13 @@ rb_struct_set(VALUE obj, VALUE val) https://github.com/ruby/ruby/blob/trunk/struct.c#L150 VALUE members, slot, fsym; long i, len; ID fid = rb_frame_this_func(); + ID this_func = fid; members = rb_struct_members(obj); len = RARRAY_LEN(members); rb_struct_modify(obj); fid = rb_id_attrget(fid); - if (!fid) not_a_member(rb_frame_this_func()); + if (!fid) not_a_member(this_func); fsym = ID2SYM(fid); for (i=0; i<len; i++) { slot = RARRAY_AREF(members, i); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/