Skip to content

Conversation

@sabiwara
Copy link
Contributor

Another mechanical refactor.

Comparing map keys by casting them into sets is much slower and memory intensive than checking map size + loop over the keys (bench).

Also using Enum.count_until to bail at the second different key found.

We could probably avoid the extra Enum.find pass by re-using the pattern from map fusion, but we can't reuse the exact same code because we're not checking for subtypes here (well, perhaps we could actually leverage this information and do something smart?)

Finally, removed the ? from the name since it doesn't return a bool.

@sabiwara sabiwara merged commit 16a1472 into elixir-lang:main Jan 27, 2025
8 of 9 checks passed
@sabiwara sabiwara deleted the descr-map-all-but-one branch January 27, 2025 10:06
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