diff options
| author | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2016-06-29 12:01:23 +0200 |
|---|---|---|
| committer | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2016-06-29 12:01:23 +0200 |
| commit | f0f43f8002678451bdb1e1d7ccdd5e7723949625 (patch) | |
| tree | 175fba326e0d5bf3d1e0875b7facd4e2f8fd6d7e | |
| parent | fbad57dfe085c1f1d6fe73bfe6bfab3188a91b15 (diff) | |
| download | rabbitmq-server-git-f0f43f8002678451bdb1e1d7ccdd5e7723949625.tar.gz | |
Use `rand` directly in master because we require Erlang 18.3
References rabbitmq/rabbitmq-server#860.
[#122335241]
| -rw-r--r-- | src/file_handle_cache.erl | 2 | ||||
| -rw-r--r-- | src/gm.erl | 2 | ||||
| -rw-r--r-- | src/rabbit_cli.erl | 2 | ||||
| -rw-r--r-- | src/rabbit_limiter.erl | 2 | ||||
| -rw-r--r-- | src/rabbit_mirror_queue_mode_exactly.erl | 2 | ||||
| -rw-r--r-- | src/rabbit_password.erl | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/src/file_handle_cache.erl b/src/file_handle_cache.erl index 0fa61092e7..f2c28c4e43 100644 --- a/src/file_handle_cache.erl +++ b/src/file_handle_cache.erl @@ -1477,7 +1477,7 @@ notify_age(CStates, AverageAge) -> notify_age0(Clients, CStates, Required) -> case [CState || CState <- CStates, CState#cstate.callback =/= undefined] of [] -> ok; - Notifications -> S = rand_compat:uniform(length(Notifications)), + Notifications -> S = rand:uniform(length(Notifications)), {L1, L2} = lists:split(S, Notifications), notify(Clients, Required, L2 ++ L1) end. diff --git a/src/gm.erl b/src/gm.erl index 176e14537f..3554f01d56 100644 --- a/src/gm.erl +++ b/src/gm.erl @@ -1066,7 +1066,7 @@ join_group(Self, GroupName, #gm_group { members = Members } = Group, TxnFun) -> prune_or_create_group(Self, GroupName, TxnFun), TxnFun); Alive -> - Left = lists:nth(rand_compat:uniform(length(Alive)), Alive), + Left = lists:nth(rand:uniform(length(Alive)), Alive), Handler = fun () -> join_group( diff --git a/src/rabbit_cli.erl b/src/rabbit_cli.erl index 6b35482217..d324625d1b 100644 --- a/src/rabbit_cli.erl +++ b/src/rabbit_cli.erl @@ -147,7 +147,7 @@ main(ParseFun, DoFun, UsageMod) -> start_distribution_anon(0, LastError) -> {error, LastError}; start_distribution_anon(TriesLeft, _) -> - NameCandidate = list_to_atom(rabbit_misc:format("rabbitmq-cli-~2..0b", [rand_compat:uniform(100)])), + NameCandidate = list_to_atom(rabbit_misc:format("rabbitmq-cli-~2..0b", [rand:uniform(100)])), case net_kernel:start([NameCandidate, name_type()]) of {ok, _} = Result -> Result; diff --git a/src/rabbit_limiter.erl b/src/rabbit_limiter.erl index 203e309b02..74e802b3a0 100644 --- a/src/rabbit_limiter.erl +++ b/src/rabbit_limiter.erl @@ -432,7 +432,7 @@ notify_queues(State = #lim{ch_pid = ChPid, queues = Queues}) -> %% We randomly vary the position of queues in the list, %% thus ensuring that each queue has an equal chance of %% being notified first. - {L1, L2} = lists:split(rand_compat:uniform(L), QList), + {L1, L2} = lists:split(rand:uniform(L), QList), [[ok = rabbit_amqqueue:resume(Q, ChPid) || Q <- L3] || L3 <- [L2, L1]], ok diff --git a/src/rabbit_mirror_queue_mode_exactly.erl b/src/rabbit_mirror_queue_mode_exactly.erl index 593f0a4138..c2ffa39f59 100644 --- a/src/rabbit_mirror_queue_mode_exactly.erl +++ b/src/rabbit_mirror_queue_mode_exactly.erl @@ -45,7 +45,7 @@ suggested_queue_nodes(Count, MNode, SNodes, _SSNodes, Poss) -> end}. shuffle(L) -> - {_, L1} = lists:unzip(lists:keysort(1, [{rand_compat:uniform(), N} || N <- L])), + {_, L1} = lists:unzip(lists:keysort(1, [{rand:uniform(), N} || N <- L])), L1. validate_policy(N) when is_integer(N) andalso N > 0 -> diff --git a/src/rabbit_password.erl b/src/rabbit_password.erl index b7987df1d8..0538445ab4 100644 --- a/src/rabbit_password.erl +++ b/src/rabbit_password.erl @@ -35,7 +35,7 @@ hash(HashingMod, Cleartext) -> <<SaltBin/binary, Hash/binary>>. generate_salt() -> - Salt = rand_compat:uniform(16#ffffffff), + Salt = rand:uniform(16#ffffffff), <<Salt:32>>. salted_hash(Salt, Cleartext) -> |
