summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-04 05:46:47 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-04 05:46:47 +0000
commitb4afac07bc230f1b574dd634df17d490ede899da (patch)
tree44b40b2cb07ea140f75e8316409971efb634d5f6 /variable.c
parent85073d276ac1fb6a021b5192cc25be9272473035 (diff)
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@10847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/variable.c b/variable.c
index 47ef4dd54a..11a3017339 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);
}