Skip to content

Commit

Permalink
minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Namyalg committed Dec 2, 2024
1 parent b753ba4 commit 03b6c97
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/remote-config/condition-evaluator-internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,6 @@ function compareSemanticVersions(
const version1HasSegment = version1[i] !== undefined;
const version2HasSegment = version2[i] !== undefined;

// If both are undefined, we've consumed everything and they're equal.
if (!version1HasSegment && !version2HasSegment) return predicateFn(0)

// Insert zeros if undefined for easier comparison.
if (!version1HasSegment) version1[i] = 0;
if (!version2HasSegment) version2[i] = 0;
Expand All @@ -325,5 +322,6 @@ function compareSemanticVersions(
if (version1[i] < version2[i]) return predicateFn(-1);
if (version1[i] > version2[i]) return predicateFn(1);
}
// If this point is reached, the semantic versions equal.
return predicateFn(0);
}

0 comments on commit 03b6c97

Please sign in to comment.