mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Use binary_to_integer instead of to list and back
This commit is contained in:
parent
9966df9ad4
commit
83aa3f1b9c
4 changed files with 4 additions and 4 deletions
|
@ -52,7 +52,7 @@ apply_constraint(Value, F) when is_function(F) ->
|
|||
%% Constraint functions.
|
||||
|
||||
int(Value) when is_binary(Value) ->
|
||||
try {true, list_to_integer(binary_to_list(Value))}
|
||||
try {true, binary_to_integer(Value)}
|
||||
catch _:_ -> false
|
||||
end.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue