Skip to content

Commit

Permalink
Rename i & j to proper names in forEachPositionInInventory
Browse files Browse the repository at this point in the history
  • Loading branch information
vaartis committed Dec 9, 2019
1 parent 2c4405d commit 9aec427
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/kotlin/org/kotobank/kuarry/helper/InventoryHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ internal object InventoryHelper {
* If this function returns "true", then iteration is stopped.
*/
fun forEachPositionInInventory(width: Int, height: Int, func: (position: Int, widthPos: Int, heightPos: Int) -> Boolean) {
for (i in 0 until height) {
for (j in 0 until width) {
val position = (j * height) + i
for (heightPos in 0 until height) {
for (widthPos in 0 until width) {
val position = (widthPos * height) + heightPos

if (func(position, j, i)) return
if (func(position, widthPos, heightPos)) return
}
}
}
Expand Down

0 comments on commit 9aec427

Please sign in to comment.