Use boolean for indices cow

This commit is contained in:
DBotThePony 2023-08-03 17:26:42 +07:00
parent 7b317a2efb
commit c08e262638
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -46,12 +46,12 @@ open class MatteryContainer(protected val watcher: Runnable, private val size: I
private val slots = Array(size) { ItemStack.EMPTY } private val slots = Array(size) { ItemStack.EMPTY }
private val nonEmptyFlags = BitSet() private val nonEmptyFlags = BitSet()
private var nonEmptyIndices = IntArrayList() private var nonEmptyIndices = IntArrayList()
private var indicesReferences = 0 private var indicesReferenced = false
private fun cowIndices() { private fun cowIndices() {
if (indicesReferences != 0) { if (indicesReferenced) {
nonEmptyIndices = IntArrayList(nonEmptyIndices) nonEmptyIndices = IntArrayList(nonEmptyIndices)
indicesReferences = 0 indicesReferenced = false
} }
} }
@ -514,7 +514,7 @@ open class MatteryContainer(protected val watcher: Runnable, private val size: I
private inner class Iterator : IContainerIterator { private inner class Iterator : IContainerIterator {
init { init {
indicesReferences++ indicesReferenced = true
} }
private val parent = nonEmptyIndices.intIterator() private val parent = nonEmptyIndices.intIterator()