diff options
author | Björn Gustavsson <[email protected]> | 2015-04-27 06:15:24 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-04-29 12:25:06 +0200 |
commit | f4adfc60acb46a86f49627397913b6841b744ed2 (patch) | |
tree | 071c88a5481747948c6851b7b9fa1bb171a36fa6 /lib | |
parent | fa237854a74a24ac7b940b1333828d4fffec7b5a (diff) | |
download | otp-f4adfc60acb46a86f49627397913b6841b744ed2.tar.gz otp-f4adfc60acb46a86f49627397913b6841b744ed2.tar.bz2 otp-f4adfc60acb46a86f49627397913b6841b744ed2.zip |
test_lib: Simplify uniq/0
Simplify the uniq/0 function by using erlang:unique_integer/1.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/compiler/test/test_lib.erl | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/compiler/test/test_lib.erl b/lib/compiler/test/test_lib.erl index a5e2855f8c..4ffac95489 100644 --- a/lib/compiler/test/test_lib.erl +++ b/lib/compiler/test/test_lib.erl @@ -57,10 +57,8 @@ parallel() -> end. uniq() -> - U0 = erlang:ref_to_list(make_ref()), - U1 = re:replace(U0, "^#Ref", ""), - U = re:replace(U1, "[^[A-Za-z0-9_]+", "_", [global]), - re:replace(U, "_*$", "", [{return,list}]). + U = erlang:unique_integer([positive]), + "_" ++ integer_to_list(U). %% Retrieve the "interesting" compiler options (options for optimization %% and compatibility) for the given module. |