Skip to content

Commit

Permalink
refactored chooseRandom function
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ext-simba-jy committed Oct 25, 2023
1 parent 0239e8f commit 6dd5dcf
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,10 +448,6 @@ function chooseRandom (firstNumber, secondNumber) {
let bigNumber = Math.max(firstNumber, secondNumber);
let smallNumber = Math.min(firstNumber, secondNumber);

if (bigNumber === smallNumber) {
return Math.random() * bigNumber;
}

return (Math.random() * (bigNumber - smallNumber)) + smallNumber;
}

Expand Down

0 comments on commit 6dd5dcf

Please sign in to comment.