aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2012-12-22 16:37:11 +0100
committerLoïc Hoguin <[email protected]>2012-12-22 16:37:11 +0100
commitcc65a723d70bb078b048bab81eeb8a4bd7ed39ce (patch)
treeec26323b67116f047fa22b7a2f8b5fdc365c98ea /src
parenta07d063fd8fc8a1cfadcb35cc89e190695773fe8 (diff)
downloadcowboy-cc65a723d70bb078b048bab81eeb8a4bd7ed39ce.tar.gz
cowboy-cc65a723d70bb078b048bab81eeb8a4bd7ed39ce.tar.bz2
cowboy-cc65a723d70bb078b048bab81eeb8a4bd7ed39ce.zip
Use lists:keyreplace/4 instead of lists:keydelete/3 + cons
Diffstat (limited to 'src')
-rw-r--r--src/cowboy_req.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cowboy_req.erl b/src/cowboy_req.erl
index b29d694..8525247 100644
--- a/src/cowboy_req.erl
+++ b/src/cowboy_req.erl
@@ -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.