Provide isNotEmpty() extension function for Maps.

This commit is contained in:
Ilya Gorbunov
2015-05-22 18:29:26 +03:00
parent 01a0348685
commit c9afb407f1
@@ -79,6 +79,9 @@ private fun mapCapacity(expectedSize: Int): Int {
return Int.MAX_VALUE // any large value
}
/** Returns true if this map is not empty. */
public fun <K, V> Map<K, V>.isNotEmpty(): Boolean = !isEmpty()
/**
* Returns the [Map] if its not null, or the empty [Map] otherwise.
*/