added notEmpty() helper method as its very common to want to do something if a collection is not empty; so if (foo.notEmpty()) is easier to read than if (!foo.isEmpty())
This commit is contained in:
@@ -8,3 +8,6 @@ inline fun <T, R> java.util.Collection<T>.map(result: Collection<R> = ArrayList<
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
/** Returns true if the collection is not empty */
|
||||
inline fun <T> java.util.Collection<T>.notEmpty() : Boolean = !this.isEmpty()
|
||||
Reference in New Issue
Block a user