mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
use mrb_intern_str instead of mrb_intern if possible
This commit is contained in:
+1
-1
@@ -1226,7 +1226,7 @@ static mrb_sym
|
||||
mrb_sym_value(mrb_state *mrb, mrb_value val)
|
||||
{
|
||||
if(val.tt == MRB_TT_STRING) {
|
||||
return mrb_intern(mrb, RSTRING_PTR(val));
|
||||
return mrb_intern_str(mrb, val);
|
||||
}
|
||||
else if(val.tt != MRB_TT_SYMBOL) {
|
||||
mrb_value obj = mrb_funcall(mrb, val, "inspect", 0);
|
||||
|
||||
+1
-1
@@ -613,7 +613,7 @@ retry:
|
||||
(int)(p - start + 1), start, mrb_sym2name(mrb, id));
|
||||
}
|
||||
symname = mrb_str_new(mrb, start + 1, p - start - 1);
|
||||
id = mrb_intern(mrb, RSTRING_PTR(symname));
|
||||
id = mrb_intern_str(mrb, symname);
|
||||
nextvalue = GETNAMEARG(mrb_symbol_value(id), start, (int)(p - start + 1));
|
||||
if (UNDEF_P(nextvalue)) {
|
||||
mrb_raise(mrb, E_KEY_ERROR, "key%.*s not found", (int)(p - start + 1), start);
|
||||
|
||||
Reference in New Issue
Block a user