-
Notifications
You must be signed in to change notification settings - Fork 17
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
Strict version of Map.filterKeys
#176
Comments
The mapValues has the same promise in its deprecation and suffers the same performance issue. I did not need it yet, but I guess it should be added for completeness:
|
Note that @OndrejSpanel you don't want the strict version IIUC, since that is what Rather, it seems you want a lazy version that behaves like |
Is that even possible? And if it is, I find it hard to believe any lazy solution would work well when chained multiple times, which is what my use case really is - like Maybe what I really want is my workaround and I do not need this API at all. Maybe it is not possible to be more efficient? |
Map.filterKeys is deprecated as the moment. Its deprecation message says:
The suggested
.view.filterKeys(p).toMap
is not very efficient, it rebuilds the whole map. Could a strict version be added as promised by the deprecation warning?Following workaround provides a more efficient solution for those interested:
See also https://stackoverflow.com/q/78354572/16673
The text was updated successfully, but these errors were encountered: