Skip to content
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

Mechanical refactor of Descr, avoid intermediate lists #14230

Merged
merged 2 commits into from
Jan 27, 2025

Conversation

sabiwara
Copy link
Contributor

I noticed a couple of places where we were building intermediate lists which could be done in a single pass.

@@ -2970,4 +2968,8 @@ defmodule Module.Types.Descr do
end

defp iterator_non_disjoint_intersection?(:none, _map), do: false

defp map_or([head | tail], fun) do
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
defp map_or([head | tail], fun) do
defp non_empty_map_or([head | tail], fun) do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@gldubc gldubc left a comment

Choose a reason for hiding this comment

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

Neat!

@sabiwara sabiwara merged commit f94f4d5 into elixir-lang:main Jan 27, 2025
9 checks passed
@sabiwara sabiwara deleted the descr-refactor branch January 27, 2025 10:52
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.

3 participants