Skip to content

Commit

Permalink
Avoid unnecessary type conversion
Browse files Browse the repository at this point in the history
The integer_to_binary/1 function is available since OTP R16B, we don't
support older versions.
  • Loading branch information
weiss committed Jul 20, 2023
1 parent 3bf0dae commit 17512c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stun.erl
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ clean_treap(Treap, CleanPriority) ->
make_nonce(Addr, Nonces) ->
Priority = now_priority(),
{TS, _} = Priority,
Nonce = list_to_binary(integer_to_list(rand_uniform(1 bsl 32))),
Nonce = integer_to_binary(rand_uniform(1 bsl 32)),
NewNonces = clean_treap(Nonces, TS + ?NONCE_LIFETIME),
{Nonce, treap:insert(Nonce, Priority, Addr, NewNonces)}.

Expand Down

0 comments on commit 17512c4

Please sign in to comment.