mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
always call Hash#default if no key found; fix #3272
This commit is contained in:
+2
-5
@@ -172,11 +172,8 @@ mrb_hash_get(mrb_state *mrb, mrb_value hash, mrb_value key)
|
||||
}
|
||||
|
||||
/* not found */
|
||||
if (MRB_RHASH_DEFAULT_P(hash)) {
|
||||
/* xxx mrb_funcall_tailcall(mrb, hash, "default", 1, key); */
|
||||
return mrb_funcall(mrb, hash, "default", 1, key);
|
||||
}
|
||||
return mrb_nil_value();
|
||||
/* xxx mrb_funcall_tailcall(mrb, hash, "default", 1, key); */
|
||||
return mrb_funcall(mrb, hash, "default", 1, key);
|
||||
}
|
||||
|
||||
MRB_API mrb_value
|
||||
|
||||
Reference in New Issue
Block a user