summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-14 02:24:47 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-14 02:24:47 +0000
commita68c69d196b76d42cf74aba497a37cbf1be87bf9 (patch)
tree20b08e85fb5aab5b54802ab44f9e348c6ff434bb /object.c
parentdb318509d5546696e65e6241197cdacbe442c071 (diff)
object.c: remove unnecessary assignment
* object.c (rb_mod_const_get): remove unnecessary assignment and set path together. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/object.c b/object.c
index b3a1c97..9c84fe5 100644
--- a/object.c
+++ b/object.c
@@ -2089,10 +2089,8 @@ rb_mod_const_get(int argc, VALUE *argv, VALUE mod)
return RTEST(recur) ? rb_const_get(mod, id) : rb_const_get_at(mod, id);
}
- name = StringValue(name);
-
+ path = StringValuePtr(name);
enc = rb_enc_get(name);
- path = RSTRING_PTR(name);
if (!rb_enc_asciicompat(enc)) {
rb_raise(rb_eArgError, "invalid class path encoding (non ASCII)");