Permalink
Browse files

Modified src/sfmt_pure.erl

* sfmt_pure:gen_rand32/1
  to force applying sfmt_pure:gen_rand_all/1
  when an intstate() is given as the argument
  • Loading branch information...
1 parent f410d5d commit 5bf1504a34eb21aef8460d09351e89036e35f784 @jj1bdx committed May 28, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/sfmt_pure.erl
View
@@ -453,8 +453,10 @@ init_by_list32(Key) ->
gen_rand32(L) when is_list(L), length(L) =:= ?N32 ->
% when intstate() is directly passed
- [H|T] = L,
- {H, {T, L}};
+ % note: given intstate() is re-initialized by gen_rand_all/1
+ L2 = gen_rand_all(L),
+ [H|T] = L2,
+ {H, {T, L2}};
gen_rand32({[], I}) ->
I2 = gen_rand_all(I),
% this operation is intstate() type dependent

0 comments on commit 5bf1504

Please sign in to comment.