diff --git a/stdlib/ktSrc/Arrays.kt b/stdlib/ktSrc/Arrays.kt index 48e1c8fc595..d7213ad4a53 100644 --- a/stdlib/ktSrc/Arrays.kt +++ b/stdlib/ktSrc/Arrays.kt @@ -101,3 +101,6 @@ inline val ByteArray.inputStream : ByteArrayInputStream inline fun ByteArray.inputStream(offset: Int, length: Int) = ByteArrayInputStream(this, offset, length) +/** Returns true if the array is not empty */ +inline fun Array.notEmpty() : Boolean = this.size > 0 + diff --git a/stdlib/ktSrc/JavaCollections.kt b/stdlib/ktSrc/JavaCollections.kt index d788529d489..c213215cb32 100644 --- a/stdlib/ktSrc/JavaCollections.kt +++ b/stdlib/ktSrc/JavaCollections.kt @@ -8,3 +8,6 @@ inline fun java.util.Collection.map(result: Collection = ArrayList< result.add(transform(item)) return result } + +/** Returns true if the collection is not empty */ +inline fun java.util.Collection.notEmpty() : Boolean = !this.isEmpty() \ No newline at end of file