mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Return nil if type differ in String#<=>.
This commit is contained in:
+1
-1
@@ -926,7 +926,7 @@ mrb_str_cmp_m(mrb_state *mrb, mrb_value str1)
|
||||
else {
|
||||
mrb_value tmp = mrb_funcall(mrb, str2, "<=>", 1, str1);
|
||||
|
||||
if (!mrb_nil_p(tmp)) return mrb_nil_value();
|
||||
if (mrb_nil_p(tmp)) return mrb_nil_value();
|
||||
if (!mrb_fixnum_p(tmp)) {
|
||||
return mrb_funcall(mrb, mrb_fixnum_value(0), "-", 1, tmp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user