diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-07 04:26:55 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-07 04:26:55 +0000 |
commit | 082a8864445f804a08ecf0f0cb8ae9a934435026 (patch) | |
tree | 2fd856bd6971c24f1fda6e6d2adf819ee4e96602 /vm_eval.c | |
parent | 5bec2d8ccdfafa6c2ae7ae93e436cacabddb8d0d (diff) | |
download | ruby-082a8864445f804a08ecf0f0cb8ae9a934435026.tar.gz |
vm_eval.c: hide intermediate hash
* vm_eval.c (rb_f_local_variables): hide intermediate hash and use
rb_hash_keys() directly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_eval.c')
-rw-r--r-- | vm_eval.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1918,6 +1918,7 @@ rb_f_local_variables(void) vars.tbl = rb_hash_new(); RHASH(vars.tbl)->ntbl = st_init_numtable(); /* compare_by_identity */ + RBASIC_CLEAR_CLASS(vars.tbl); while (cfp) { if (cfp->iseq) { for (i = 0; i < cfp->iseq->local_table_size; i++) { @@ -1941,9 +1942,8 @@ rb_f_local_variables(void) break; } } - /* TODO: rb_hash_keys() directly, or something not to depend on - * the order of st_table */ - ary = rb_funcallv(vars.tbl, rb_intern("keys"), 0, 0); + /* TODO: not to depend on the order of st_table */ + ary = rb_hash_keys(vars.tbl); rb_hash_clear(vars.tbl); return ary; } |