Skip to content

Commit

Permalink
improve / fix computeFiniteResult method
Browse files Browse the repository at this point in the history
Whoops... the function now does what it says it does, even though the old logic was actually fine for the current requirement
  • Loading branch information
SlicedSilver committed Jun 29, 2023
1 parent bf08fb1 commit 57e030f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/model/price-range-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ function computeFiniteResult(
): number {
const firstFinite = Number.isFinite(valueOne);
return firstFinite && Number.isFinite(valueTwo)
? ensureFiniteWithFallback(method(valueOne, valueTwo), fallback)
? method(valueOne, valueTwo)
: firstFinite
? valueOne
: valueTwo;
: ensureFiniteWithFallback(valueTwo, fallback);
}

export class PriceRangeImpl {
Expand Down

0 comments on commit 57e030f

Please sign in to comment.