Commit 668d632c authored by KOBAYASHI Shuji's avatar KOBAYASHI Shuji

pack: Remove redundant float check in pack_utf8()

The argument is converted to fixnum before calling.
parent 3e59f25e
......@@ -457,11 +457,6 @@ pack_utf8(mrb_state *mrb, mrb_value o, mrb_value str, mrb_int sidx, long count,
int len = 0;
uint32_t c = 0;
#ifndef MRB_WITHOUT_FLOAT
if (mrb_float_p(o)) {
goto range_error;
}
#endif
c = (uint32_t)mrb_fixnum(o);
/* Unicode character */
......@@ -489,9 +484,6 @@ pack_utf8(mrb_state *mrb, mrb_value o, mrb_value str, mrb_int sidx, long count,
len = 4;
}
else {
#ifndef MRB_WITHOUT_FLOAT
range_error:
#endif
mrb_raise(mrb, E_RANGE_ERROR, "pack(U): value out of range");
}
......
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