mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
numeric.c (cmpnum): skip mrb_as_float() if possible
This commit is contained in:
+6
-1
@@ -1922,8 +1922,13 @@ cmpnum(mrb_state *mrb, mrb_value v1, mrb_value v2)
|
||||
#ifdef MRB_USE_BIGINT
|
||||
case MRB_TT_BIGINT:
|
||||
#endif
|
||||
case MRB_TT_FLOAT:
|
||||
case MRB_TT_INTEGER:
|
||||
if (mrb_fixnum_p(v2)) {
|
||||
y = (mrb_float)mrb_integer(v2);
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
case MRB_TT_FLOAT:
|
||||
y = mrb_as_float(mrb, v2);
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user