1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Make prefix static

This commit is contained in:
Nobuyoshi Nakada 2019-11-08 23:00:36 +09:00
parent ff2d99406d
commit 11e21f1982
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -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 {