mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
replace memcpy() with a magic number by two assignments as suggested by @cremno; close #2048
This commit is contained in:
+2
-1
@@ -401,7 +401,8 @@ sym_inspect(mrb_state *mrb, mrb_value sym)
|
||||
memcpy(RSTRING_PTR(str)+1, name, len);
|
||||
if (!symname_p(name) || strlen(name) != len) {
|
||||
str = mrb_str_dump(mrb, str);
|
||||
memcpy(RSTRING_PTR(str), ":\"", 2);
|
||||
RSTRING_PTR(str)[0] = ':';
|
||||
RSTRING_PTR(str)[1] = '"';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user