summaryrefslogtreecommitdiffhomepage
path: root/src/numeric.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/numeric.c')
-rw-r--r--src/numeric.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/numeric.c b/src/numeric.c
index 46b3cdf37..4c955a61e 100644
--- a/src/numeric.c
+++ b/src/numeric.c
@@ -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