From 6def265d793d401f59d57349190fdd1974f166e4 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 8 Dec 2013 11:38:34 +0000 Subject: variable.c: frozen class name * variable.c (fc_path, classname): return ID strings without unnecessary copying. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- variable.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'variable.c') diff --git a/variable.c b/variable.c index c65fdcb423..ded150e30c 100644 --- a/variable.c +++ b/variable.c @@ -49,7 +49,7 @@ fc_path(struct fc_result *fc, ID name) { VALUE path, tmp; - path = rb_str_dup(rb_id2str(name)); + path = rb_id2str(name); while (fc) { st_data_t n; if (fc->track == rb_cObject) break; @@ -176,8 +176,7 @@ classname(VALUE klass, int *permanent) return Qnil; } if (!st_lookup(RCLASS_IV_TBL(klass), (st_data_t)tmp_classpath, &n)) { - path = rb_str_dup(rb_id2str(cid)); - OBJ_FREEZE(path); + path = rb_id2str(cid); return path; } *permanent = 0; -- cgit v1.2.3