Skip to content

Commit 3139168

Browse files
committed
Remove is_map/1 optimization that breaks reduce on structs
1 parent 03189d0 commit 3139168

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

lib/elixir/lib/enum.ex

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,10 +1211,6 @@ defmodule Enum do
12111211
:lists.foldl(fun, acc, collection)
12121212
end
12131213

1214-
def reduce(collection, acc, fun) when is_map(collection) do
1215-
:maps.fold(fn k, v, acc -> fun.({ k, v }, acc) end, acc, collection)
1216-
end
1217-
12181214
def reduce(collection, acc, fun) do
12191215
Enumerable.reduce(collection, { :cont, acc },
12201216
fn x, acc -> { :cont, fun.(x, acc) } end) |> elem(1)

0 commit comments

Comments
 (0)