Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from Dmitry-Me/equalitycomparison
Comparison for equality was heavily duplicated.
- Loading branch information
Showing
3 changed files
with
23 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 6 additions & 5 deletions
11
...z/packagenamingpackage/impl/math/arithmetics/NumberIsMultipleOfAnotherNumberVerifier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...ngpackage/impl/strategies/comparators/integercomparator/IntegerForEqualityComparator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.strategies.comparators.integercomparator; | ||
|
||
public class IntegerForEqualityComparator { | ||
public static boolean areTwoIntegersEqual(int nFirstInteger, int nSecondInteger) { | ||
ThreeWayIntegerComparisonResult comparisonResult = | ||
ThreeWayIntegerComparator.Compare(nFirstInteger, nSecondInteger); | ||
if (comparisonResult == ThreeWayIntegerComparisonResult.FirstEqualsSecond) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
joezeng
Author
Contributor
|
||
return true; | ||
} else { | ||
return false; | ||
} | ||
} | ||
} |
What if the result of this comparison is neither true nor false?