From 1c72b75fc314ba23f395794ad27716b8971a4c6c Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 18 Jul 2017 15:50:06 +0200 Subject: [PATCH] Optimize function --- Math/Functions/Functions.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Math/Functions/Functions.php b/Math/Functions/Functions.php index a4381130a..c8332f253 100644 --- a/Math/Functions/Functions.php +++ b/Math/Functions/Functions.php @@ -239,11 +239,7 @@ class Functions */ public static function isOdd($a) : bool { - if ($a & 1) { - return true; - } - - return false; + return $a & 1; } /** @@ -258,11 +254,7 @@ class Functions */ public static function isEven($a) : bool { - if ($a & 1) { - return false; - } - - return true; + return !($a & 1) } /**