Commit 444e4b79 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2538 from kkkkkt/refactor-method

refactor mruby method(fix indent. remove temporary value etc)
parents 98a95530 2f1d12c7
......@@ -739,7 +739,6 @@ mrb_obj_methods(mrb_state *mrb, mrb_bool recur, mrb_value obj, mrb_method_flag_t
{
if (recur)
return mrb_class_instance_method_list(mrb, recur, mrb_class(mrb, obj), 0);
else
return mrb_obj_singleton_methods(mrb, recur, obj);
}
/* 15.3.1.3.31 */
......
......@@ -337,7 +337,7 @@ read_debug_record(mrb_state *mrb, const uint8_t *start, mrb_irep* irep, size_t *
size_t len;
int ret;
ret =read_debug_record(mrb, bin, irep->reps[i], &len, filenames, filenames_len);
ret = read_debug_record(mrb, bin, irep->reps[i], &len, filenames, filenames_len);
if (ret != MRB_DUMP_OK) return ret;
bin += len;
}
......@@ -570,7 +570,6 @@ MRB_API mrb_value
mrb_load_irep_cxt(mrb_state *mrb, const uint8_t *bin, mrbc_context *c)
{
mrb_irep *irep = mrb_read_irep(mrb, bin);
mrb_value val;
struct RProc *proc;
if (!irep) {
......@@ -580,8 +579,7 @@ mrb_load_irep_cxt(mrb_state *mrb, const uint8_t *bin, mrbc_context *c)
proc = mrb_proc_new(mrb, irep);
mrb_irep_decref(mrb, irep);
if (c && c->no_exec) return mrb_obj_value(proc);
val = mrb_toplevel_run(mrb, proc);
return val;
return mrb_toplevel_run(mrb, proc);
}
MRB_API mrb_value
......
......@@ -310,12 +310,9 @@ convert_type(mrb_state *mrb, mrb_value val, const char *tname, const char *metho
if (!mrb_respond_to(mrb, val, m)) {
if (raise) {
mrb_raisef(mrb, E_TYPE_ERROR, "can't convert %S into %S", inspect_type(mrb, val), mrb_str_new_cstr(mrb, tname));
return mrb_nil_value();
}
else {
return mrb_nil_value();
}
}
return mrb_funcall_argv(mrb, val, m, 0, 0);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment