diff options
author | Lars Thorsen <[email protected]> | 2015-04-29 07:13:51 +0200 |
---|---|---|
committer | Lars Thorsen <[email protected]> | 2015-05-08 12:32:15 +0200 |
commit | c84295904be29cbcbd3f91d009db91eca94ff158 (patch) | |
tree | 95ce646dd9653536b1fbda6e1de2211bff6e252f /lib/orber | |
parent | 9ca2c2fcc364ee320c61281cf0e89fdd120617c9 (diff) | |
download | otp-c84295904be29cbcbd3f91d009db91eca94ff158.tar.gz otp-c84295904be29cbcbd3f91d009db91eca94ff158.tar.bz2 otp-c84295904be29cbcbd3f91d009db91eca94ff158.zip |
[orber] Use rand instead of random
Diffstat (limited to 'lib/orber')
-rw-r--r-- | lib/orber/src/cdr_decode.erl | 8 | ||||
-rw-r--r-- | lib/orber/src/orber_socket.erl | 3 |
2 files changed, 4 insertions, 7 deletions
diff --git a/lib/orber/src/cdr_decode.erl b/lib/orber/src/cdr_decode.erl index 796cc2686b..00dcf01c56 100644 --- a/lib/orber/src/cdr_decode.erl +++ b/lib/orber/src/cdr_decode.erl @@ -1110,9 +1110,8 @@ ifrid_to_name(Id, Type) -> [?LINE, Id, Type], ?DEBUG_LEVEL), corba:raise(#'MARSHAL'{completion_status=?COMPLETED_MAYBE}); Nodes -> - random:seed(rlang:monotonic_time(), erlang:current_time_offset(), rlang:unique_integer()), L = length(Nodes), - IFR = get_ifr_node(Nodes, random:uniform(L), L), + IFR = get_ifr_node(Nodes, rand:uniform(L), L), list_to_atom('OrberApp_IFR':get_absolute_name(IFR, Id)) end; {'EXIT', Other} -> @@ -1175,7 +1174,7 @@ get_ifr_node(Nodes, N, L) -> _ -> %% Not able to commincate with the node. Try next one. NewL = L-1, - get_ifr_node(lists:delete(Node, Nodes), random:uniform(NewL), NewL) + get_ifr_node(lists:delete(Node, Nodes), rand:uniform(NewL), NewL) end. @@ -1259,9 +1258,8 @@ get_user_exception_type(TypeId) -> completion_status=?COMPLETED_MAYBE}) end; Nodes -> - random:seed(rlang:monotonic_time(), erlang:current_time_offset(), rlang:unique_integer()), L = length(Nodes), - IFR = get_ifr_node(Nodes, random:uniform(L), L), + IFR = get_ifr_node(Nodes, rand:uniform(L), L), 'OrberApp_IFR':get_user_exception_type(IFR, TypeId) end end. diff --git a/lib/orber/src/orber_socket.erl b/lib/orber/src/orber_socket.erl index 8ee1611c65..4567728693 100644 --- a/lib/orber/src/orber_socket.erl +++ b/lib/orber/src/orber_socket.erl @@ -167,7 +167,6 @@ multi_connect([CurrentPort|Rest], Retries, ssl, Host, Port, Options, Timeout) -> get_port_sequence(Min, Max) -> case orber_env:iiop_out_ports_random() of true -> - random:seed(rlang:monotonic_time(), erlang:current_time_offset(), rlang:unique_integer()), Seq = lists:seq(Min, Max), random_sequence((Max - Min) + 1, Seq, []); _ -> @@ -177,7 +176,7 @@ get_port_sequence(Min, Max) -> random_sequence(0, _, Acc) -> Acc; random_sequence(Length, Seq, Acc) -> - Nth = random:uniform(Length), + Nth = rand:uniform(Length), Value = lists:nth(Nth, Seq), NewSeq = lists:delete(Value, Seq), random_sequence(Length-1, NewSeq, [Value|Acc]). |