mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* string.c (sym_to_proc): tabified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a9a4435e12
commit
53e7e2d2a1
1 changed files with 8 additions and 8 deletions
16
string.c
16
string.c
|
@ -6922,9 +6922,9 @@ sym_to_proc(VALUE sym)
|
|||
VALUE *aryp;
|
||||
|
||||
if (!sym_proc_cache) {
|
||||
sym_proc_cache = rb_ary_tmp_new(SYM_PROC_CACHE_SIZE * 2);
|
||||
rb_gc_register_mark_object(sym_proc_cache);
|
||||
rb_ary_store(sym_proc_cache, SYM_PROC_CACHE_SIZE*2 - 1, Qnil);
|
||||
sym_proc_cache = rb_ary_tmp_new(SYM_PROC_CACHE_SIZE * 2);
|
||||
rb_gc_register_mark_object(sym_proc_cache);
|
||||
rb_ary_store(sym_proc_cache, SYM_PROC_CACHE_SIZE*2 - 1, Qnil);
|
||||
}
|
||||
|
||||
id = SYM2ID(sym);
|
||||
|
@ -6932,13 +6932,13 @@ sym_to_proc(VALUE sym)
|
|||
|
||||
aryp = RARRAY_PTR(sym_proc_cache);
|
||||
if (aryp[index] == sym) {
|
||||
return aryp[index + 1];
|
||||
return aryp[index + 1];
|
||||
}
|
||||
else {
|
||||
proc = rb_proc_new(sym_call, (VALUE)id);
|
||||
aryp[index] = sym;
|
||||
aryp[index + 1] = proc;
|
||||
return proc;
|
||||
proc = rb_proc_new(sym_call, (VALUE)id);
|
||||
aryp[index] = sym;
|
||||
aryp[index + 1] = proc;
|
||||
return proc;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue