aboutsummaryrefslogtreecommitdiffstats
path: root/time.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-21 13:36:03 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-21 13:36:03 +0000
commitf52ec74516e955d1325ad39dd5481ccaf043f244 (patch)
treeacf3f92e7cf2f2c34e6b8eedde7c935ad1c7e75d /time.c
parent980c798a9713a1d8d1318fa15dd9014cc66ebf66 (diff)
downloadruby-f52ec74516e955d1325ad39dd5481ccaf043f244.tar.gz
* internal.h (rb_fix_divmod_fix): like r54213, use FIX2NUM only if
x == FIXNUM_MIN && y == -1. This must be a rare case and it is expected compiler to handle well. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r--time.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/time.c b/time.c
index 1279cc2203..8321e81591 100644
--- a/time.c
+++ b/time.c
@@ -109,7 +109,7 @@ mod(VALUE x, VALUE y)
{
if (FIXNUM_P(y)) {
if (FIX2LONG(y) == 0) rb_num_zerodiv();
- if (FIXNUM_P(x)) return LONG2FIX(rb_mod(FIX2LONG(x), FIX2LONG(y)));
+ if (FIXNUM_P(x)) return rb_fix_mod_fix(x, y);
}
if (RB_TYPE_P(x, T_BIGNUM)) return rb_big_modulo(x, y);
return rb_funcall(x, '%', 1, y);