Commit 72fe54c4 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2172 from suzukaze/refactor-numeric.c

Refactor rshift
parents 85d286b4 129e5a6c
......@@ -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