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
@@ -39,7 +39,10 @@ internal constructor(@PublishedApi internal val storage: IntArray) : Collection<
override fun contains(element: UInt): Boolean = storage.contains(element.toInt())
override fun containsAll(elements: Collection<UInt>): Boolean = elements.all { storage.contains(it.toInt()) }
override fun containsAll(elements: Collection<UInt>): Boolean {
if ((elements as Collection<Any?>).any { it as? UInt == null }) return false
return elements.all { storage.contains(it.toInt()) }
}
override fun isEmpty(): Boolean = this.storage.size == 0
}