Merge pull request #178 from ariel-anieli/remove-random-uniform

Replaced random_uniform/1 by rand:uniform/1
This commit is contained in:
Fred Hebert 2024-07-02 16:01:21 -04:00 committed by GitHub
commit 1fd0a513ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -223,7 +223,7 @@ real_dir_path(Path) ->
%% function of the same name. %% function of the same name.
-spec insecure_mkdtemp() -> TmpDirPath::file:name() | {error, term()}. -spec insecure_mkdtemp() -> TmpDirPath::file:name() | {error, term()}.
insecure_mkdtemp() -> insecure_mkdtemp() ->
UniqueNumber = erlang:integer_to_list(erlang:trunc(random_uniform() * 1000000000000)), UniqueNumber = erlang:integer_to_list(erlang:trunc(rand:uniform() * 1_000_000_000_000)),
TmpDirPath = TmpDirPath =
filename:join([tmp(), lists:flatten([".tmp_dir", UniqueNumber])]), filename:join([tmp(), lists:flatten([".tmp_dir", UniqueNumber])]),
@ -376,9 +376,6 @@ sub_files(From) ->
{ok, SubFiles} = file:list_dir(From), {ok, SubFiles} = file:list_dir(From),
[filename:join(From, SubFile) || SubFile <- SubFiles]. [filename:join(From, SubFile) || SubFile <- SubFiles].
random_uniform() ->
rand:uniform().
%%%=================================================================== %%%===================================================================
%%% Test Functions %%% Test Functions
%%%=================================================================== %%%===================================================================