mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 20:30:23 +00:00
Match early in connection_to_atom for a small performance improvement.
This commit is contained in:
parent
71e940a6eb
commit
5726aa3d85
1 changed files with 4 additions and 0 deletions
|
@ -215,6 +215,10 @@ version_to_connection({1, 1}) -> keepalive;
|
|||
version_to_connection(_Any) -> close.
|
||||
|
||||
-spec connection_to_atom(Connection::string()) -> keepalive | close.
|
||||
connection_to_atom("keep-alive") ->
|
||||
keepalive;
|
||||
connection_to_atom("close") ->
|
||||
close;
|
||||
connection_to_atom(Connection) ->
|
||||
case string:to_lower(Connection) of
|
||||
"close" -> close;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue