using kotlin's newfangled 'x in xs.indices' instead of 'x in 0 until xs.size'

This commit is contained in:
minjaesong
2020-10-21 17:42:58 +09:00
parent 2437fed1ea
commit 0c48b9dce8
12 changed files with 25 additions and 25 deletions

View File

@@ -153,7 +153,7 @@ internal object ReadLayerDataLzma {
val fluidFills = HashMap<BlockAddress, Float>()
// parse terrain damages
for (c in 0 until payloadBytes["TdMG"]!!.size step 10) {
for (c in payloadBytes["TdMG"]!!.indices step 10) {
val bytes = payloadBytes["TdMG"]!!
val tileAddr = bytes.sliceArray(c..c+5)
@@ -164,7 +164,7 @@ internal object ReadLayerDataLzma {
// parse wall damages
for (c in 0 until payloadBytes["WdMG"]!!.size step 10) {
for (c in payloadBytes["WdMG"]!!.indices step 10) {
val bytes = payloadBytes["WdMG"]!!
val tileAddr = bytes.sliceArray(c..c+5)

View File

@@ -154,7 +154,7 @@ internal object ReadLayerDataZip {
val fluidFills = HashMap<BlockAddress, Float>()
// parse terrain damages
for (c in 0 until payloadBytes["TdMG"]!!.size step 10) {
for (c in payloadBytes["TdMG"]!!.indices step 10) {
val bytes = payloadBytes["TdMG"]!!
val tileAddr = bytes.sliceArray(c..c+5)
@@ -165,7 +165,7 @@ internal object ReadLayerDataZip {
// parse wall damages
for (c in 0 until payloadBytes["WdMG"]!!.size step 10) {
for (c in payloadBytes["WdMG"]!!.indices step 10) {
val bytes = payloadBytes["WdMG"]!!
val tileAddr = bytes.sliceArray(c..c+5)