diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-13 09:59:22 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-13 09:59:22 +0000 |
commit | fa8b08b4248d66a172369f4654fec9bdba8c748f (patch) | |
tree | b1217f07f36c92fca08b5f5ee720dc5596de17ff /proc.c | |
parent | 83a01e6f529b80a876508b9501b64e8f1f1414da (diff) | |
download | ruby-fa8b08b4248d66a172369f4654fec9bdba8c748f.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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; } |