From d815a071503c53988d6e20b934ff881ed0089ab4 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 13 Oct 2018 09:59:22 +0000 Subject: 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 --- file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'file.c') diff --git a/file.c b/file.c index 12299adad6..bdec438217 100644 --- a/file.c +++ b/file.c @@ -6276,7 +6276,7 @@ Init_File(void) rb_define_singleton_method(rb_cFile, "extname", rb_file_s_extname, 1); rb_define_singleton_method(rb_cFile, "path", rb_file_s_path, 1); - separator = rb_fstring_cstr("/"); + separator = rb_fstring_lit("/"); /* separates directory parts in path */ rb_define_const(rb_cFile, "Separator", separator); /* separates directory parts in path */ -- cgit v1.2.3