Use boolean for indices cow
This commit is contained in:
parent
7b317a2efb
commit
c08e262638
@ -46,12 +46,12 @@ open class MatteryContainer(protected val watcher: Runnable, private val size: I
|
||||
private val slots = Array(size) { ItemStack.EMPTY }
|
||||
private val nonEmptyFlags = BitSet()
|
||||
private var nonEmptyIndices = IntArrayList()
|
||||
private var indicesReferences = 0
|
||||
private var indicesReferenced = false
|
||||
|
||||
private fun cowIndices() {
|
||||
if (indicesReferences != 0) {
|
||||
if (indicesReferenced) {
|
||||
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 {
|
||||
init {
|
||||
indicesReferences++
|
||||
indicesReferenced = true
|
||||
}
|
||||
|
||||
private val parent = nonEmptyIndices.intIterator()
|
||||
|
Loading…
Reference in New Issue
Block a user