[stdlib] Replace usage of Enum.values with Enum.entries
This commit is contained in:
committed by
Space Team
parent
2d08953c91
commit
99d5ee4db8
@@ -57,7 +57,7 @@ internal fun wasiPrintImpl(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
throw WasiError(WasiErrorCode.values()[ret])
|
throw WasiError(WasiErrorCode.entries[ret])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ private fun wasiRandomGet(): Long {
|
|||||||
return if (ret == 0) {
|
return if (ret == 0) {
|
||||||
memory.loadLong()
|
memory.loadLong()
|
||||||
} else {
|
} else {
|
||||||
throw WasiError(WasiErrorCode.values()[ret])
|
throw WasiError(WasiErrorCode.entries[ret])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ private fun clockTimeGet(): Long = withScopedMemoryAllocator { allocator ->
|
|||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
rp0.loadLong()
|
rp0.loadLong()
|
||||||
} else {
|
} else {
|
||||||
throw WasiError(WasiErrorCode.values()[ret])
|
throw WasiError(WasiErrorCode.entries[ret])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user