From c08e262638542242f218fe9a9ce3890b8cbaf5bf Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Thu, 3 Aug 2023 17:26:42 +0700 Subject: [PATCH] Use boolean for indices cow --- .../ru/dbotthepony/mc/otm/container/MatteryContainer.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/container/MatteryContainer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/container/MatteryContainer.kt index 5a285fbe3..e03d238fd 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/container/MatteryContainer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/container/MatteryContainer.kt @@ -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()