Skip to content

Commit

Permalink
Fix DEOPT:overflow of Random::uniformIn
Browse files Browse the repository at this point in the history
  • Loading branch information
dubzzz committed Oct 10, 2018
1 parent 01255d4 commit 6afe3da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/random/generator/Random.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export class Random {
}

private uniformIn(rangeMin: number, rangeMax: number): number {
const [v, nrng] = prand.uniformIntDistribution(rangeMin, rangeMax, this.internalRng);
this.internalRng = nrng;
return v;
const g = prand.uniformIntDistribution(rangeMin, rangeMax, this.internalRng);
this.internalRng = g[1];
return g[0];
}

/**
Expand Down

0 comments on commit 6afe3da

Please sign in to comment.