diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-12-08 04:18:01 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-12-08 04:18:01 +0000 |
commit | 07bb8b4cce6037ee3a05d765cf26c52fd4b0b4ff (patch) | |
tree | 1949ea8f83833b7f31f4582e765e586b43361684 /struct.c | |
parent | f975d1153c22292e759f3d2deedddc0c4c3a5325 (diff) |
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
Diffstat (limited to 'struct.c')
-rw-r--r-- | struct.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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<len; i++) { slot = RARRAY_AREF(members, i); |