Skip to content
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

How to lazy evaluate for the first return value of FilterMap #488

Open
kcmvp opened this issue Jul 8, 2024 · 1 comment
Open

How to lazy evaluate for the first return value of FilterMap #488

kcmvp opened this issue Jul 8, 2024 · 1 comment

Comments

@kcmvp
Copy link

kcmvp commented Jul 8, 2024

FilterMap function return a value and a bool value to identify skip current value or not. If the return bool value is false then no need to return the value( just zero or nil) enough, is there a way to defer the object creation? My case is use FilterMap to process a huge collection

@shivamrazorpay
Copy link
Contributor

@kcmvp, even if the value is returned it will not be used anywhere. So there the object creation is being done in the callback function. If you want the the return of bool when false should be zero or nil , you can write that implementation in the callback function itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants