summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-08 11:38:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-08 11:38:34 +0000
commit6def265d793d401f59d57349190fdd1974f166e4 (patch)
tree51dbbdb3947c414c5fc58dd9f613db62ce28946c /variable.c
parent91092927891c892b2c4c8fd6df4ac0d739470610 (diff)
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
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c5
1 files changed, 2 insertions, 3 deletions
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;