Skip to content

Commit 338e242

Browse files
author
José Valim
committed
Avoid protocol dispatch and multiple lists conversion in the formatter
Signed-off-by: José Valim <[email protected]>
1 parent 2de4680 commit 338e242

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/elixir/lib/code/formatter.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ defmodule Code.Formatter do
254254
|> Keyword.get(:locals_without_parens, [])
255255
|> MapSet.new()
256256
|> MapSet.union(@locals_without_parens)
257+
|> MapSet.to_list()
257258

258259
%{
259260
locals_without_parens: locals_without_parens,
@@ -2088,7 +2089,7 @@ defmodule Code.Formatter do
20882089
defp force_keyword?([{{_, meta, _}, _} | keyword], lines) do
20892090
line = line(meta)
20902091

2091-
if line in lines do
2092+
if MapSet.member?(lines, line) do
20922093
false
20932094
else
20942095
force_keyword?(keyword, MapSet.put(lines, line))

0 commit comments

Comments
 (0)