From 07bb8b4cce6037ee3a05d765cf26c52fd4b0b4ff Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 8 Dec 2014 04:18:01 +0000 Subject: struct.c: trivial optimization * struct.c (rb_struct_set): get rid of calling rb_frame_this_func twice. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- struct.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'struct.c') diff --git a/struct.c b/struct.c index cbc40286c2..93c55999c0 100644 --- a/struct.c +++ b/struct.c @@ -150,12 +150,13 @@ rb_struct_set(VALUE obj, VALUE val) 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