summaryrefslogtreecommitdiff
path: root/enumerator.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-28 08:15:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-28 08:15:42 +0000
commit95d1b61a146f9e88564d3df7e648b78881741a61 (patch)
tree80a5e7736295617b89cdd4c1b16d631b00daa759 /enumerator.c
parente4c92f24fe23fbadc1a92f4e545b2a594ea56cba (diff)
symbols instead of IDs
* encoding.c (rb_enc_get_index): deal with symbols instead of IDs to get rid of inadvertent pin-downs. * enum.c (chunk_ii): ditto. * enumerator.c (append_method): ditto. * iseq.c (iseq_load): ditto. * marshal.c (w_symbol, r_symlink, r_symreal, r_symbol): ditto. * signal.c (trap_handler): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enumerator.c')
-rw-r--r--enumerator.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/enumerator.c b/enumerator.c
index bd75b00..eaa3d73 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -975,13 +975,15 @@ append_method(VALUE obj, VALUE str, ID default_method, VALUE default_args)
method = rb_attr_get(obj, id_method);
if (method != Qfalse) {
- ID mid = default_method;
if (!NIL_P(method)) {
Check_Type(method, T_SYMBOL);
- mid = SYM2ID(method);
+ method = rb_sym2str(method);
+ }
+ else {
+ method = rb_id2str(default_method);
}
rb_str_buf_cat2(str, ":");
- rb_str_buf_append(str, rb_id2str(mid));
+ rb_str_buf_append(str, method);
}
eargs = rb_attr_get(obj, id_arguments);