Reports emptiness checks on filtered collections.
The quick-fix uses exists
or forall
to check for emptiness.
Example:
var x: Seq[Int]
x.filter(p).size == 0
x.filter(p).length > 0
x.filterNot(p).isEmpty
x.filterNot(p).nonEmpty
After the quick-fix is applied:
var x: Seq[Int]
!x.exists(p)
x.exists(p)
x.forall(p)
!x.forall(p)