Awesome! :D
On Saturday, July 9, 2016 at 8:35:56 PM UTC+2, Aleksei Magusev wrote:
>
> From now on we're rewriting Enum.into/2,3 with empty map into Map.new/1,2
> during compilation. :)
>
> On Friday, July 8, 2016 at 1:44:11 PM UTC+2, Ben Wilson wrote:
>>
>> I looked at having a fast path for Enum.into when I did the original
>> Map.new upgrades and we decided against it. When the goal is to create a
>> map from scratch |> Map.new is the clearest way to write that. The fast
>> path for Enum.into would require that the second arg is BOTH a map AND an
>> empty map, otherwise you can't use Map.new. If Enum.into(%{}) were the best
>> way to create a new map from some other thing it would be worth the extra
>> code path but I see Map.new as superior for that purpose.
>>
>> I do agree that documentation in Enum could mention that. I'm inclined to
>> stick it in the moduledoc though because it applies to conceptually to the
>> whole module. By way of example, it's just as relevant to filter as it is
>> to map.
>>
>
--
You received this message because you are subscribed to the Google Groups
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elixir-lang-core/5a20df6e-525d-4b8f-bbd5-04358d919f98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.