We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following code which contains a filter followed in map (the reciprocal is also possible) can be optimized with the collect method:
List(1, 2, 3, 4).filter(_ % 2 == 0).map(_ * 2)
Propose to the user the following code:
List(1, 2, 3, 4).collect { case x if x%2 == 0 => x * 2 }
.
No response
code action, map, filter, collect, optimisation
The text was updated successfully, but these errors were encountered:
Thanks for reporting! That looks like a great Idea!
Sorry, something went wrong.
i'm interested in implementing this feature; could anyone help me with pointers on where to look for?
Convert to collect
Successfully merging a pull request may close this issue.
Is your feature request related to a problem? Please describe.
The following code which contains a filter followed in map (the reciprocal is also possible) can be optimized with the collect method:
Describe the solution you'd like
Propose to the user the following code:
Describe alternatives you've considered
.
Additional contex
No response
Search terms
code action, map, filter, collect, optimisation
The text was updated successfully, but these errors were encountered: