From 195edd9076c865f8af6a9aeeb02bc032b94c0fb3 Mon Sep 17 00:00:00 2001 From: Guilherme Andrade Date: Wed, 22 Mar 2017 21:51:17 +0000 Subject: fixup! Support cryptographically strong rand plugin Minimize use of guards. --- lib/stdlib/src/rand.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/stdlib/src/rand.erl b/lib/stdlib/src/rand.erl index ddd22914e2..60da53cd2b 100644 --- a/lib/stdlib/src/rand.erl +++ b/lib/stdlib/src/rand.erl @@ -88,15 +88,15 @@ seed(Alg) -> seed_put(seed_s(Alg)). -spec seed_s(AlgOrStateOrExpState::builtin_alg() | state() | export_state()) -> state(). -seed_s(Alg) when is_atom(Alg) -> - seed_s(Alg, {erlang:phash2([{node(),self()}]), - erlang:system_time(), - erlang:unique_integer()}); seed_s({AlgHandler, _Seed} = State) when is_map(AlgHandler) -> State; seed_s({Alg0, Seed}) -> {Alg,_SeedFun} = mk_alg(Alg0), - {Alg, Seed}. + {Alg, Seed}; +seed_s(Alg) -> + seed_s(Alg, {erlang:phash2([{node(),self()}]), + erlang:system_time(), + erlang:unique_integer()}). %% seed/2: seeds RNG with the algorithm and given values %% and returns the NEW state. -- cgit v1.2.3