Skip to content

Commit

Permalink
Simplify return type of SFC64's set_seed function
Browse files Browse the repository at this point in the history
  • Loading branch information
Pass Automated Testing Suite authored and zoj613 committed Apr 18, 2024
1 parent 9c10f42 commit 657d551
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/sfc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,16 @@ end = struct
rnd *. (1.0 /. 9007199254740992.0), t'


let set_seed t (w, x, y) =
let set_seed (w, x, y) =
let rec loop s' = function
| 0 -> s'
| i -> loop (next s' |> snd) (i - 1)
in
{t with s = loop (w, x, y, Uint64.one) 12}
loop (w, x, y, Uint64.one) 12


let initialize seed =
let istate = Seed.SeedSequence.generate_64bit_state 3 seed in
set_seed
{s = Uint64.(zero, zero, zero, zero); has_uint32 = false; uinteger = Uint32.zero}
(istate.(0), istate.(1), istate.(2))
{s = set_seed (istate.(0), istate.(1), istate.(2));
has_uint32 = false; uinteger = Uint32.zero}
end

0 comments on commit 657d551

Please sign in to comment.