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 /load.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 'load.c')
-rw-r--r-- | load.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -604,7 +604,7 @@ rb_load_internal0(rb_execution_context_t *ec, VALUE fname, int wrap) VALUE parser = rb_parser_new(); rb_parser_set_context(parser, NULL, FALSE); ast = (rb_ast_t *)rb_parser_load_file(parser, fname); - iseq = rb_iseq_new_top(&ast->body, rb_fstring_cstr("<top (required)>"), + iseq = rb_iseq_new_top(&ast->body, rb_fstring_lit("<top (required)>"), fname, rb_realpath_internal(Qnil, fname, 1), NULL); rb_ast_dispose(ast); } |