Skip to content

Commit e5d8b00

Browse files
committed
Remove maps:put/3 inlining, as it is done by the Erlang compiler, closes #15313
1 parent 2ba06cc commit e5d8b00

2 files changed

Lines changed: 0 additions & 36 deletions

File tree

lib/elixir/src/elixir_erl_pass.erl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -576,19 +576,6 @@ translate_remote('Elixir.String.Chars', to_string, Meta, [Arg], S) ->
576576
{clause, Generated, [Var], [[Guard]], [Fast]},
577577
{clause, Generated, [Var], [], [Slow]}
578578
]}, VS};
579-
translate_remote(maps, put, Meta, [Key, Value, Map], S) ->
580-
Ann = ?ann(Meta),
581-
582-
case translate_args([Key, Value, Map], Ann, S) of
583-
{[TKey, TValue, {map, _, InnerMap, Pairs}], TS} ->
584-
{{map, Ann, InnerMap, Pairs ++ [{map_field_assoc, Ann, TKey, TValue}]}, TS};
585-
586-
{[TKey, TValue, {map, _, Pairs}], TS} ->
587-
{{map, Ann, Pairs ++ [{map_field_assoc, Ann, TKey, TValue}]}, TS};
588-
589-
{[TKey, TValue, TMap], TS} ->
590-
{{map, Ann, TMap, [{map_field_assoc, Ann, TKey, TValue}]}, TS}
591-
end;
592579
translate_remote(lists, member, Meta, [Expr, [Head | Tail] = List], S) ->
593580
Ann = ?ann(Meta),
594581

lib/elixir/test/erlang/control_test.erl

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -69,29 +69,6 @@ optimized_inspect_interpolation_test() ->
6969
{call, _, {remote, _,{atom, _, 'Elixir.Kernel'}, {atom, _, inspect}}, [_]},
7070
default, [binary]}]} = to_erl("\"#{inspect(1)}\"").
7171

72-
optimized_map_put_test() ->
73-
{map, _,
74-
[{map_field_assoc, _, {atom, _, a}, {integer, _, 1}},
75-
{map_field_assoc, _, {atom, _, b}, {integer, _, 2}}]
76-
} = to_erl("Map.put(%{a: 1}, :b, 2)").
77-
78-
optimized_map_put_variable_test() ->
79-
{block, _,
80-
[_,
81-
{map, _, {var, _, _},
82-
[{map_field_assoc, _, {atom, _, a}, {integer, _, 1}}]
83-
}]
84-
} = to_erl("x = %{}; Map.put(x, :a, 1)").
85-
86-
optimized_nested_map_put_variable_test() ->
87-
{block, _,
88-
[_,
89-
{map, _, {var, _, _},
90-
[{map_field_assoc, _, {atom, _, a}, {integer, _, 1}},
91-
{map_field_assoc, _, {atom, _, b}, {integer, _, 2}}]
92-
}]
93-
} = to_erl("x = %{}; Map.put(Map.put(x, :a, 1), :b, 2)").
94-
9572
optimized_map_merge_test() ->
9673
{map, _,
9774
[{map_field_assoc, _, {atom, _, a}, {integer, _, 1}},

0 commit comments

Comments
 (0)