diff --git a/mrbgems/mruby-struct/src/struct.c b/mrbgems/mruby-struct/src/struct.c index 1f3ae290f..28ba9c3db 100644 --- a/mrbgems/mruby-struct/src/struct.c +++ b/mrbgems/mruby-struct/src/struct.c @@ -659,34 +659,28 @@ mrb_struct_eql(mrb_state *mrb, mrb_value s) mrb_value s2; mrb_value *ptr, *ptr2; mrb_int i, len; - mrb_bool eql_p; mrb_get_args(mrb, "o", &s2); if (mrb_obj_equal(mrb, s, s2)) { - eql_p = 1; + return mrb_true_value(); } - else if (strcmp(mrb_class_name(mrb, mrb_obj_class(mrb, s2)), "Struct") || - mrb_obj_class(mrb, s) != mrb_obj_class(mrb, s2)) { - eql_p = 0; + if (strcmp(mrb_class_name(mrb, mrb_obj_class(mrb, s2)), "Struct") || + mrb_obj_class(mrb, s) != mrb_obj_class(mrb, s2)) { + return mrb_false_value(); } - else if (RSTRUCT_LEN(s) != RSTRUCT_LEN(s2)) { + if (RSTRUCT_LEN(s) != RSTRUCT_LEN(s2)) { mrb_bug(mrb, "inconsistent struct"); /* should never happen */ - eql_p = 0; /* This substuture is just to suppress warnings. never called. */ } - else { - ptr = RSTRUCT_PTR(s); - ptr2 = RSTRUCT_PTR(s2); - len = RSTRUCT_LEN(s); - eql_p = 1; - for (i=0; i