Fix UArray.containsAll(Collection<Any?>)
This commit is contained in:
committed by
Ilya Gorbunov
parent
60e83383ad
commit
c1b523ddef
@@ -39,7 +39,10 @@ internal constructor(@PublishedApi internal val storage: ByteArray) : Collection
|
||||
|
||||
override fun contains(element: UByte): Boolean = storage.contains(element.toByte())
|
||||
|
||||
override fun containsAll(elements: Collection<UByte>): Boolean = elements.all { storage.contains(it.toByte()) }
|
||||
override fun containsAll(elements: Collection<UByte>): Boolean {
|
||||
if ((elements as Collection<Any?>).any { it as? UByte == null }) return false
|
||||
return elements.all { storage.contains(it.toByte()) }
|
||||
}
|
||||
|
||||
override fun isEmpty(): Boolean = this.storage.size == 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user