aboutsummaryrefslogtreecommitdiffstats
path: root/proc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-13 09:59:22 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-13 09:59:22 +0000
commitd815a071503c53988d6e20b934ff881ed0089ab4 (patch)
treeb1217f07f36c92fca08b5f5ee720dc5596de17ff /proc.c
parentd55e5f6f88ed03b3c9e10a4e813d1637a2e9db39 (diff)
downloadruby-d815a071503c53988d6e20b934ff881ed0089ab4.tar.gz
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 'proc.c')
-rw-r--r--proc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/proc.c b/proc.c
index 74800e63ca..6713d5e0f7 100644
--- a/proc.c
+++ b/proc.c
@@ -1643,7 +1643,7 @@ method_owner(VALUE obj)
void
rb_method_name_error(VALUE klass, VALUE str)
{
-#define MSG(s) rb_fstring_cstr("undefined method `%1$s' for"s" `%2$s'")
+#define MSG(s) rb_fstring_lit("undefined method `%1$s' for"s" `%2$s'")
VALUE c = klass;
VALUE s;
@@ -2819,7 +2819,7 @@ proc_binding(VALUE self)
const struct vm_ifunc *ifunc = block->as.captured.code.ifunc;
if (IS_METHOD_PROC_IFUNC(ifunc)) {
VALUE method = (VALUE)ifunc->data;
- VALUE name = rb_fstring_cstr("<empty_iseq>");
+ VALUE name = rb_fstring_lit("<empty_iseq>");
rb_iseq_t *empty;
binding_self = method_receiver(method);
iseq = rb_method_iseq(method);
@@ -2852,7 +2852,7 @@ proc_binding(VALUE self)
}
else {
RB_OBJ_WRITE(bindval, &bind->pathobj,
- rb_iseq_pathobj_new(rb_fstring_cstr("(binding)"), Qnil));
+ rb_iseq_pathobj_new(rb_fstring_lit("(binding)"), Qnil));
bind->first_lineno = 1;
}