I have a list I want to filter, but end after a certain amount of successful items in the result. How would I do that?
My filter has an expensive operation
list.filter(expensiveOperation)
and I only need say 20 results from the list.
list.view.filter(expensiveOperation).take(20).toList
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With