Skip to content

Commit

Permalink
fix(splitGenerator): use the nextGenerator as the seed value
Browse files Browse the repository at this point in the history
  • Loading branch information
TylorS committed May 28, 2017
1 parent ea3f07d commit a332d5a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/splitGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ export const splitGenerator: SplitGenerator = curry2(
seed: RandomNumberGenerator): ReadonlyArray<RandomNumberGenerator>
{
const generators: Array<RandomNumberGenerator> = Array(quantity)
let generator = seed

for (let i = 0; i < Math.max(Math.round(quantity), 1); ++i) {
const { value, nextGenerator } = next(seed)
const { value, nextGenerator } = next(generator)

generators[i] = nextGenerator
generator = nextGenerator

seed = createWithSeed(value)
}
Expand Down

0 comments on commit a332d5a

Please sign in to comment.