-
Notifications
You must be signed in to change notification settings - Fork 170
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
prefer_spread_collections
trigger on .toIterable()
#5092
Comments
I'm not sure the difference between Which one is more readable depends on what you're more used to. The I'm not sure I'd want a recommendation for spreads over |
The only reason I lean over using the spread operator is that for non-nullable fields/variables, it is easier to use it over the |
Ack, me too. The former makes it easier to read that the set is created no matter what, and the elements are conditioned on list not being (Do consider not having nullable lists at all, and always use an empty list instead of On the other hand, I don't prefer The two expressions are probably mostly equivalent in most cases. All considerations included, there is no clear winner in either performance or readability that applies to all cases, so I wouldn't want to mandate, or even recommend, one of |
Describe the issue
The current description or
prefer_spread_collections
:I'd like to bring focus to the end:
So I'd like to propose for it to trigger on methods like
toSet
andtoList
.To Reproduce
Expected behavior
For it to trigger
prefer_spread_collections
in the second line.The text was updated successfully, but these errors were encountered: