Skip to content

Commit

Permalink
chore(release-model): Invert logic at comparing-function with numbers…
Browse files Browse the repository at this point in the history
… for clearer understanding
  • Loading branch information
aivruu committed Aug 29, 2024
1 parent ddeee22 commit 264f6fa
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public String[] semanticVersion() {
*
* @param comparingOperator the operator-type to use for this comparing.
* @param targetVersion the version to compare.
* @return A boolean-state indicating if the version-comparing for the specified operator-tyé returned true,
* @return A boolean-state indicating if the version-comparing for the specified operator-type returned true,
* otherwise false.
* @since 3.4.4
*/
Expand All @@ -128,11 +128,11 @@ public boolean compareVersionFromNumber(final VersionComparingOperators comparin
final var versionStringToNumber = Integer.parseInt(versionWithoutDots.startsWith("v")
? versionWithoutDots.substring(1) : versionWithoutDots);
return switch (comparingOperator) {
case EQUAL -> versionStringToNumber == targetVersion;
case LESS -> versionStringToNumber < targetVersion;
case LESS_OR_EQUAL -> versionStringToNumber <= targetVersion;
case GREATER -> versionStringToNumber > targetVersion;
case GREATER_OR_EQUAL -> versionStringToNumber >= targetVersion;
case EQUAL -> targetVersion == versionStringToNumber;
case LESS -> targetVersion < versionStringToNumber;
case LESS_OR_EQUAL -> targetVersion <= versionStringToNumber;
case GREATER -> targetVersion > versionStringToNumber;
case GREATER_OR_EQUAL -> targetVersion >= versionStringToNumber;
// Should not happen never, but we define it to avoid syntax errors.
default -> false;
};
Expand Down

0 comments on commit 264f6fa

Please sign in to comment.