Commit 129e5a6c authored by Jun Hiroe's avatar Jun Hiroe

Refactor rshift

parent 85d286b4
......@@ -980,17 +980,11 @@ rshift(mrb_int val, mrb_int width)
mrb_assert(width >= 0);
if (width >= NUMERIC_SHIFT_WIDTH_MAX) {
if (val < 0) {
val = -1;
}
else {
val = 0;
return mrb_fixnum_value(-1);
}
return mrb_fixnum_value(0);
}
else {
val = val >> width;
}
return mrb_fixnum_value(val);
return mrb_fixnum_value(val >> width);
}
static inline void
......
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