From 179ef8d366935d5b34f1482d69288d27eb0b33eb Mon Sep 17 00:00:00 2001 From: Linus Sellberg Date: Mon, 5 Aug 2019 17:52:02 +0200 Subject: [PATCH] Int#divisible_by? doesn't care about the value being floored. Potentially the if statement in % might be optimized away, but why force LLVM to optimize something when it isn't necessary? --- src/int.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/int.cr b/src/int.cr index 26f086367a8d..04b4073aef09 100644 --- a/src/int.cr +++ b/src/int.cr @@ -366,7 +366,7 @@ struct Int end def divisible_by?(num) - self % num == 0 + remainder(num) == 0 end def even?