tkutil.c: use local variables

* ext/tk/tkutil/tkutil.c (cbsubst_table_setup): use local
  variables instead of repeating RARRAY_PTR.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-09-27 09:57:58 +00:00
parent 05b844723b
commit dca6009c3e

View File

@ -1615,14 +1615,15 @@ cbsubst_table_setup(argc, argv, self)
*/ */
len = RARRAY_LEN(proc_inf); len = RARRAY_LEN(proc_inf);
for(idx = 0; idx < len; idx++) { for(idx = 0; idx < len; idx++) {
VALUE type, proc;
inf = RARRAY_PTR(proc_inf)[idx]; inf = RARRAY_PTR(proc_inf)[idx];
if (!RB_TYPE_P(inf, T_ARRAY)) continue; if (!RB_TYPE_P(inf, T_ARRAY)) continue;
if (RARRAY_LEN(inf) < 2) continue; if (RARRAY_LEN(inf) < 2) continue;
rb_hash_aset(subst_inf->proc, type = rb_ary_entry(inf, 0);
(RB_TYPE_P(RARRAY_PTR(inf)[0], T_STRING)? proc = rb_ary_entry(inf, 1);
INT2FIX(*(RSTRING_PTR(RARRAY_PTR(inf)[0]))) : if (RB_TYPE_P(type, T_STRING))
RARRAY_PTR(inf)[0]), type = INT2FIX(*(RSTRING_PTR(type)));
RARRAY_PTR(inf)[1]); rb_hash_aset(subst_inf->proc, type, proc);
} }
rb_const_set(self, ID_SUBST_INFO, cbsubst_obj); rb_const_set(self, ID_SUBST_INFO, cbsubst_obj);