aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-11-08 23:00:36 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-11-08 23:00:36 +0900
commit11e21f1982cbe41860b3f6755505ce063b74fc33 (patch)
treef9a3f6f4055fd959edb1e635ad4e78d7d5515a45 /compile.c
parentff2d99406db4cd8aa0164c86525eedf627acffbe (diff)
downloadruby-11e21f1982cbe41860b3f6755505ce063b74fc33.tar.gz
Make prefix static
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/compile.c b/compile.c
index 1f4031a53f..131f82a47d 100644
--- a/compile.c
+++ b/compile.c
@@ -6753,10 +6753,10 @@ static const char *
iseq_builtin_function_name(ID mid)
{
const char *name = rb_id2name(mid);
- const char prefix[] = "__builtin_";
- const size_t prefix_len = strlen(prefix);
+ static const char prefix[] = "__builtin_";
+ const size_t prefix_len = sizeof(prefix) - 1;
- if (UNLIKELY(strncmp("__builtin_", name, prefix_len) == 0)) {
+ if (UNLIKELY(strncmp(prefix, name, prefix_len) == 0)) {
return &name[prefix_len];
}
else {