I was recently going back through old code changing my foreach loops to streams, and I ran across an if statement like condition && condition
. So at first I did
.stream()
.filter(x -> cond && cond)
But then I realised it would look better with two filters, one for each condition.
Which is better convention, and which is more efficient when compiled (if there is any difference at all)?