0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 04:30:25 +00:00

Use lists:keyreplace/4 instead of lists:keydelete/3 + cons

This commit is contained in:
Loïc Hoguin 2012-12-22 16:37:11 +01:00
parent a07d063fd8
commit cc65a723d7

View file

@ -537,7 +537,7 @@ meta(Name, Req, Default) ->
%% If the value already exists it will be overwritten.
-spec set_meta(atom(), any(), Req) -> Req when Req::req().
set_meta(Name, Value, Req=#http_req{meta=Meta}) ->
Req#http_req{meta=[{Name, Value}|lists:keydelete(Name, 1, Meta)]}.
Req#http_req{meta=lists:keyreplace(Name, 1, Meta, {Name, Value})}.
%% Request Body API.