From 11e21f1982cbe41860b3f6755505ce063b74fc33 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 8 Nov 2019 23:00:36 +0900 Subject: [PATCH] Make prefix static --- compile.c | 6 +++--- 1 file 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 {