Change from for loop to Hardcode
All checks were successful
Deploy datapack to dev / Build (push) Successful in 7s

This commit is contained in:
themodernhakr 2025-03-22 21:55:43 -05:00
parent 5e44a9eb28
commit 490c3a9032

View File

@ -26,10 +26,14 @@ class database {
class database.benchmark {
function arrayTest1.setup() {
::database.test.arrayTest1.array = [];
for ($i=0;$i<=500;$i++) {
::database.test.arrayTest1.array << {id: "n", string: "array item &<$i>"};
logger(1, database.benchmark.arrayTest1.setup, "Loop ran");
Hardcode.repeat(
indexString="[index]",
start=0,
stop=500,
function=() => {
::database.test.arrayTest1.array << {id: Hardcode.calc([index]+1), string: "entryHardcode.calc([index]+1)"};
}
);
}
function arrayTest1.print() {
tellraw @a {"nbt":"database.test.arrayTest1.array","storage":"ferdinland:ferdinland"};