Skip to content

fix matching on every map in Enum.into/2 #2164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 11, 2014

Conversation

liveforeverx
Copy link
Contributor

No description provided.

@@ -838,15 +838,16 @@ defmodule Enum do
list ++ to_list(collection)
end

def into(collection, %{}) when is_list(collection) do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the map_size/1 guard!

@josevalim
Copy link
Member

Doh, good catch! I have added a comment. Can you please add a test as well? :)

josevalim pushed a commit that referenced this pull request Apr 11, 2014
fix matching on every map in Enum.into/2
@josevalim josevalim merged commit 0883c75 into elixir-lang:master Apr 11, 2014
@liveforeverx liveforeverx deleted the fix_enum branch April 11, 2014 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants