Remove unnecessary mrb_funcall().

This commit is contained in:
Yukihiro "Matz" Matsumoto
2019-10-22 22:49:12 +09:00
parent 11184e9186
commit 9540a8309c
+6 -5
View File
@@ -284,12 +284,13 @@ mrb_io_alloc(mrb_state *mrb)
#endif
static int
option_to_fd(mrb_state *mrb, mrb_value obj, const char *key)
option_to_fd(mrb_state *mrb, mrb_value hash, const char *key)
{
mrb_value opt = mrb_funcall(mrb, obj, "[]", 1, mrb_symbol_value(mrb_intern_static(mrb, key, strlen(key))));
if (mrb_nil_p(opt)) {
return -1;
}
mrb_value opt;
if (!mrb_hash_p(hash)) return -1;
opt = mrb_hash_fetch(mrb, hash, mrb_symbol_value(mrb_intern_static(mrb, key, strlen(key))), mrb_nil_value());
if (mrb_nil_p(opt)) return -1;
switch (mrb_type(opt)) {
case MRB_TT_DATA: /* IO */