Skip to content

Commit

Permalink
Remove an extra return.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Jun 5, 2024
1 parent 10b61d2 commit f501f07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/random-uint-below/randomUIntBelow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function randomUIntBelow(max: number): number {
// val % max would produce a biased result. This bias can be very bad if `max` is on the order of MAX_JS_PRECISE_INT. We have to try again, so just call ourselves recursively.
// For some values of `max` just above 9007199254740992 / 2, this happens about once on average. For other values of `max`, it's less than that (and for small values of `max` it's extremely unlikely).
// TODO: Use more bits of accuracy instead of rejection sampling to avoid DoS.
return (val = random53BitNumber());
val = random53BitNumber();
}
return val % max;
}

0 comments on commit f501f07

Please sign in to comment.