aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/cowboy_req.erl10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cowboy_req.erl b/src/cowboy_req.erl
index 8726779..b13da50 100644
--- a/src/cowboy_req.erl
+++ b/src/cowboy_req.erl
@@ -1194,13 +1194,13 @@ kvlist_to_map(Keys, [{Key, Value}|Tail], Map) ->
case maps:find(Atom, Map) of
{ok, MapValue} when is_list(MapValue) ->
kvlist_to_map(Keys, Tail,
- maps:put(Atom, [Value|MapValue], Map));
+ Map#{Atom => [Value|MapValue]});
{ok, MapValue} ->
kvlist_to_map(Keys, Tail,
- maps:put(Atom, [Value, MapValue], Map));
+ Map#{Atom => [Value, MapValue]});
error ->
kvlist_to_map(Keys, Tail,
- maps:put(Atom, Value, Map))
+ Map#{Atom => Value})
end;
false ->
kvlist_to_map(Keys, Tail, Map)
@@ -1221,7 +1221,7 @@ filter([{Key, Constraints, Default}|Tail], Map) ->
{ok, Value} ->
filter_constraints(Tail, Map, Key, Value, Constraints);
error ->
- filter(Tail, maps:put(Key, Default, Map))
+ filter(Tail, Map#{Key => Default})
end;
filter([Key|Tail], Map) ->
true = maps:is_key(Key, Map),
@@ -1232,7 +1232,7 @@ filter_constraints(Tail, Map, Key, Value, Constraints) ->
true ->
filter(Tail, Map);
{true, Value2} ->
- filter(Tail, maps:put(Key, Value2, Map))
+ filter(Tail, Map#{Key => Value2})
end.
%% Tests.