Skip to content
New issue

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

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

Already on GitHub? # to your account

Prefer Enumerable#flat_map over .map.flatten chain #378

Merged
merged 1 commit into from
Jul 3, 2021

Conversation

ashmaroli
Copy link
Contributor

#flat_map is generally faster as result of not having to create an intermediate array and traverse one array lesser.

Ref: https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code

@sporkmonger sporkmonger changed the base branch from master to main July 3, 2021 04:21
@sporkmonger sporkmonger self-requested a review July 3, 2021 04:22
@sporkmonger sporkmonger merged commit e9c76b8 into sporkmonger:main Jul 3, 2021
@ashmaroli ashmaroli deleted the flat-map branch August 26, 2021 08:59
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants