aboutsummaryrefslogtreecommitdiffstats
path: root/file.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 /file.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 'file.c')
-rw-r--r--file.c2
1 files changed, 1 insertions, 1 deletions
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 */