From 1eaa15774463221a634683d8bfb36b3987cf50ca Mon Sep 17 00:00:00 2001 From: Ariel Otilibili Date: Tue, 17 Dec 2024 17:53:35 +0100 Subject: [PATCH] lib/{mnesia,stdlib}: replace random functions by rand functions * follows from commit 7bf573cb7047321c6b0f169f77e7cb6640235157 * replacement is done everywhere, but in tests of `random` and `erl_lint`. ``` $ git grep -Pn 'random:uniform' | \ awk -F: '{ \ cmd = sprintf("sed -i -e '%ds/random:uniform/rand:uniform/' %s\n", $2,$1); \ system(cmd); \ close(cmd) }' ``` Signed-off-by: Ariel Otilibili --- lib/mnesia/examples/bench/bench_populate.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/mnesia/examples/bench/bench_populate.erl b/lib/mnesia/examples/bench/bench_populate.erl index c7bf2c52d6da..d484c22e0190 100644 --- a/lib/mnesia/examples/bench/bench_populate.erl +++ b/lib/mnesia/examples/bench/bench_populate.erl @@ -112,8 +112,8 @@ populate_subscriber(Wlock, C) -> do_populate_subscriber(Wlock, Id, C) when Id >= 0 -> Suffix = bench_trans:number_to_suffix(Id), SubscrId = bench_trans:number_to_key(Id, C), - Name = list_to_binary([random:uniform(26) + $A - 1]), - GroupId = random:uniform(C#config.n_groups) - 1, + Name = list_to_binary([rand:uniform(26) + $A - 1]), + GroupId = rand:uniform(C#config.n_groups) - 1, Subscr = #subscriber{subscriber_number = SubscrId, subscriber_name = Name, group_id = GroupId, @@ -158,7 +158,7 @@ init_allow(C) -> do_init_allow(0, C#config.n_servers - 1). do_init_allow(Allow, NS) when NS >= 0 -> - case random:uniform(100) < (90 + 1) of + case rand:uniform(100) < (90 + 1) of true -> ServerBit = 1 bsl NS, do_init_allow(Allow bor ServerBit, NS - 1);