Skip to content

Commit cb24fe0

Browse files
committed
lib/{mnesia,stdlib}: replace random functions by rand functions
* follows from commit 7bf573c * replacement is done everywhere, but in tests of `random` and `erl_lint`. Signed-off-by: Ariel Otilibili <[email protected]>
1 parent 350b1d6 commit cb24fe0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/mnesia/examples/bench/bench_populate.erl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,16 @@ create_tables(C) ->
104104
%% -------------------------------------------------------------------
105105

106106
populate_subscriber(Wlock, C) ->
107-
random:seed(),
107+
rand:seed(),
108108
N = C#config.n_subscribers,
109109
?d(" Populate ~p subscribers...", [N]),
110110
do_populate_subscriber(Wlock, N - 1, C).
111111

112112
do_populate_subscriber(Wlock, Id, C) when Id >= 0 ->
113113
Suffix = bench_trans:number_to_suffix(Id),
114114
SubscrId = bench_trans:number_to_key(Id, C),
115-
Name = list_to_binary([random:uniform(26) + $A - 1]),
116-
GroupId = random:uniform(C#config.n_groups) - 1,
115+
Name = list_to_binary([rand:uniform(26) + $A - 1]),
116+
GroupId = rand:uniform(C#config.n_groups) - 1,
117117
Subscr = #subscriber{subscriber_number = SubscrId,
118118
subscriber_name = Name,
119119
group_id = GroupId,
@@ -134,7 +134,7 @@ do_populate_subscriber(_Wlock, _, _) ->
134134
%% -------------------------------------------------------------------
135135

136136
populate_group(Wlock, C) ->
137-
random:seed(),
137+
rand:seed(),
138138
N = C#config.n_groups,
139139
?d(" Populate ~p groups...", [N]),
140140
do_populate_group(Wlock, N - 1, C).
@@ -158,7 +158,7 @@ init_allow(C) ->
158158
do_init_allow(0, C#config.n_servers - 1).
159159

160160
do_init_allow(Allow, NS) when NS >= 0 ->
161-
case random:uniform(100) < (90 + 1) of
161+
case rand:uniform(100) < (90 + 1) of
162162
true ->
163163
ServerBit = 1 bsl NS,
164164
do_init_allow(Allow bor ServerBit, NS - 1);
@@ -173,7 +173,7 @@ do_init_allow(Allow, _) ->
173173
%% -------------------------------------------------------------------
174174

175175
populate_server(Wlock, C) ->
176-
random:seed(),
176+
rand:seed(),
177177
N = C#config.n_servers,
178178
?d(" Populate ~p servers with 100 records each...", [N]),
179179
do_populate_server(Wlock, N - 1).

0 commit comments

Comments
 (0)