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 /eval_error.c | |
parent | 83a01e6f529b80a876508b9501b64e8f1f1414da (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 'eval_error.c')
-rw-r--r-- | eval_error.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/eval_error.c b/eval_error.c index 99941163d5..237c96d84f 100644 --- a/eval_error.c +++ b/eval_error.c @@ -292,7 +292,7 @@ rb_ec_error_print(rb_execution_context_t * volatile ec, volatile VALUE errinfo) rb_ec_raised_set(ec, raised_flag); } -#define undef_mesg_for(v, k) rb_fstring_cstr("undefined"v" method `%1$s' for "k" `%2$s'") +#define undef_mesg_for(v, k) rb_fstring_lit("undefined"v" method `%1$s' for "k" `%2$s'") #define undef_mesg(v) ( \ is_mod ? \ undef_mesg_for(v, "module") : \ @@ -320,7 +320,7 @@ rb_print_undef_str(VALUE klass, VALUE name) rb_name_err_raise_str(undef_mesg(""), klass, name); } -#define inaccessible_mesg_for(v, k) rb_fstring_cstr("method `%1$s' for "k" `%2$s' is "v) +#define inaccessible_mesg_for(v, k) rb_fstring_lit("method `%1$s' for "k" `%2$s' is "v) #define inaccessible_mesg(v) ( \ is_mod ? \ inaccessible_mesg_for(v, "module") : \ |