filterNot(x).isNotEmpty() is equivalent to any(!x)
c.any{it == x} is equivalent to x in c
I find future me tends to remember what I was doing faster when I use the any/none/all functions. (They also short-circuit, but the readability boost to my productivity helps more than the loop optimization)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Unsolicited code review:
filter(x).isEmpty()
is equivalent tonone(x)
filter(x).isNotEmpty()
is equivalent toany(x)
filterNot(x).isEmpty()
is equivalent toall(x)
filterNot(x).isNotEmpty()
is equivalent toany(!x)
c.any{it == x}
is equivalent tox in c
I find future me tends to remember what I was doing faster when I use the any/none/all functions. (They also short-circuit, but the readability boost to my productivity helps more than the loop optimization)