From f08c9c2db7f1557539b1a5e0d3433941fa42b1c4 Mon Sep 17 00:00:00 2001 From: nbourlier <76502895+nbourlier@users.noreply.github.com> Date: Mon, 17 Apr 2023 09:19:26 -0700 Subject: [PATCH] Update NumberIsMultipleOfAnotherNumberVerifier.java Simplify boolean logic in NumberIsMultipleOfAnotherNumberVerifier --- .../NumberIsMultipleOfAnotherNumberVerifier.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/java/com/seriouscompany/business/java/fizzbuzz/packagenamingpackage/impl/math/arithmetics/NumberIsMultipleOfAnotherNumberVerifier.java b/src/main/java/com/seriouscompany/business/java/fizzbuzz/packagenamingpackage/impl/math/arithmetics/NumberIsMultipleOfAnotherNumberVerifier.java index d58d6b27..82d5ee73 100644 --- a/src/main/java/com/seriouscompany/business/java/fizzbuzz/packagenamingpackage/impl/math/arithmetics/NumberIsMultipleOfAnotherNumberVerifier.java +++ b/src/main/java/com/seriouscompany/business/java/fizzbuzz/packagenamingpackage/impl/math/arithmetics/NumberIsMultipleOfAnotherNumberVerifier.java @@ -41,12 +41,7 @@ public static boolean numberIsMultipleOfAnotherNumber(final int nFirstNumber, fi (NumberIsMultipleOfAnotherNumberVerifier.integerDivider.divide(nFirstNumber, nSecondNumber)); final int nMultiplyDivisionResultBySecondIntegerResult = nDivideFirstIntegerBySecondIntegerResult * nSecondNumber; - if (IntegerForEqualityComparator.areTwoIntegersEqual(nMultiplyDivisionResultBySecondIntegerResult, - nFirstNumber)) { - return true; - } else { - return false; - } + return IntegerForEqualityComparator.areTwoIntegersEqual(nMultiplyDivisionResultBySecondIntegerResult, nFirstNumber); } catch (final ArithmeticException ae) { return false; }