nah it’s not the same
# getting-started
o
nah it’s not the same
s
you can
filter
for multiple conditions in the same block or for each condition individually in each
filter
call. Each
filter
would effectively be equivalent to
.filter { cond1 && cond2 && cond3 ...}
o
ahh so they are the same
thanks
s
I mean, it really depends on how you write the individual filters vs the composite predicate
also without using sequences, it’s multiple iterations of up to the entire collection, which could be problematic depending on how large your data set is
o
so how do I filter inside a for loop while maintaining a desirable result as if i had run
filter
in a chain?
because i have an array of predicates, and each can be either false or true, and according to that, I filter
I wish I could chain the filters in the loop, more desirable than producing unexpected combinations in
&&
like @Shawn said