summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-13 09:59:22 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-13 09:59:22 (GMT)
commitfa8b08b4248d66a172369f4654fec9bdba8c748f (patch)
treeb1217f07f36c92fca08b5f5ee720dc5596de17ff /compile.c
parent83a01e6f529b80a876508b9501b64e8f1f1414da (diff)
Prefer `rb_fstring_lit` over `rb_fstring_cstr`
The former states explicitly that the argument must be a literal, and can optimize away `strlen` on all compilers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index 19f365a..12233ff 100644
--- a/compile.c
+++ b/compile.c
@@ -7153,7 +7153,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
}
case NODE_SCLASS:{
ID singletonclass;
- const rb_iseq_t *singleton_class = NEW_ISEQ(node->nd_body, rb_fstring_cstr("singleton class"),
+ const rb_iseq_t *singleton_class = NEW_ISEQ(node->nd_body, rb_fstring_lit("singleton class"),
ISEQ_TYPE_CLASS, line);
CHECK(COMPILE(ret, "sclass#recv", node->nd_recv));
@@ -8281,7 +8281,7 @@ caller_location(VALUE *path, VALUE *realpath)
return line;
}
else {
- *path = rb_fstring_cstr("<compiled>");
+ *path = rb_fstring_lit("<compiled>");
*realpath = *path;
return 1;
}