Fix UArray.containsAll(Collection<Any?>)

This commit is contained in:
Abduqodiri Qurbonzoda
2019-02-20 04:10:02 +03:00
committed by Ilya Gorbunov
parent 60e83383ad
commit c1b523ddef
6 changed files with 29 additions and 5 deletions
+4 -1
View File
@@ -353,7 +353,10 @@ class UnsignedArrayGenerator(val type: UnsignedType, out: PrintWriter) : BuiltIn
override fun contains(element: $elementType): Boolean = storage.contains(element.to$storageElementType())
override fun containsAll(elements: Collection<$elementType>): Boolean = elements.all { storage.contains(it.to$storageElementType()) }
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()) }
}
override fun isEmpty(): Boolean = this.storage.size == 0"""
)