Implement asList, slice & sliceArray extension functions for UArrays

This commit is contained in:
Abduqodiri Qurbonzoda
2019-01-24 16:55:57 +03:00
committed by Ilya Gorbunov
parent 114736c09b
commit fc85781bfc
16 changed files with 646 additions and 39 deletions
+1 -2
View File
@@ -454,8 +454,7 @@ class UnsignedArrayGenerator(val type: UnsignedType, out: PrintWriter) : BuiltIn
}
override fun containsAll(elements: Collection<$elementType>): Boolean {
if ((elements as Collection<Any?>).any { it as? $elementType == null }) return false
return elements.all { storage.contains(it.to$storageElementType()) }
return (elements as Collection<*>).all { it is $elementType && storage.contains(it.to$storageElementType()) }
}
override fun isEmpty(): Boolean = this.storage.size == 0"""