From 254458202b82d5a74e306400b4a1dd628cd1f683 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 4 Sep 2006 05:46:47 +0000 Subject: * eval.c (rb_f_local_variables): list symbols. * struct.c (rb_struct_s_members_m): ditto. * variable.c (ivar_i): ditto. * variable.c (gvar_i): ditto. * variable.c (cv_i): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- variable.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'variable.c') diff --git a/variable.c b/variable.c index 47ef4dd54..11a301733 100644 --- a/variable.c +++ b/variable.c @@ -693,7 +693,7 @@ rb_gvar_defined(struct global_entry *entry) static int gvar_i(ID key, struct global_entry *entry, VALUE ary) { - rb_ary_push(ary, rb_str_new2(rb_id2name(key))); + rb_ary_push(ary, ID2SYM(key)); return ST_CONTINUE; } @@ -988,7 +988,7 @@ static int ivar_i(ID key, struct global_entry *entry, VALUE ary) { if (rb_is_instance_id(key)) { - rb_ary_push(ary, rb_str_new2(rb_id2name(key))); + rb_ary_push(ary, ID2SYM(key)); } return ST_CONTINUE; } @@ -1418,7 +1418,7 @@ rb_mod_const_of(VALUE mod, void *data) static int list_i(ID key, ID value, VALUE ary) { - rb_ary_push(ary, rb_str_new2(rb_id2name(key))); + rb_ary_push(ary, ID2SYM(key)); return ST_CONTINUE; } @@ -1633,7 +1633,7 @@ static int cv_i(ID key, VALUE value, VALUE ary) { if (rb_is_class_id(key)) { - VALUE kval = rb_str_new2(rb_id2name(key)); + VALUE kval = ID2SYM(key); if (!rb_ary_includes(ary, kval)) { rb_ary_push(ary, kval); } -- cgit