Skip to content

Commit 1ca103d

Browse files
author
José Valim
committed
No need to reverse lists on MapSet
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
1 parent f3cbf1c commit 1ca103d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/elixir/lib/map_set.ex

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,14 @@ defmodule MapSet do
9393
end
9494

9595
defp do_new([], acc) do
96-
acc
97-
|> :lists.reverse
98-
|> :maps.from_list
96+
:maps.from_list(acc)
9997
end
10098
defp do_new([item | rest], acc) do
10199
do_new(rest, [{item, true} | acc])
102100
end
103101

104102
defp do_new_transform([], _fun, acc) do
105-
acc
106-
|> :lists.reverse
107-
|> :maps.from_list
103+
:maps.from_list(acc)
108104
end
109105
defp do_new_transform([item | rest], fun, acc) do
110106
do_new_transform(rest, fun, [{fun.(item), true} | acc])

0 commit comments

Comments
 (0)