`stream.filter { condition == null || it == condit...
# announcements
n
stream.filter { condition == null || it == condition }
👍 1
a
With this code, the list is always "filtered", which is unnecessary when
condition == null
n
c?.let { s.filter.(it::equals) } ?: s
a
thats better, but IMO the ìf/else version is more readable. Just because you can, doesn't mean you should 😄
🙂 1
n
It depends. If it is a part of a chain then single-statement is ok.