From 8a4bd9e9b986c5f113bcdfc884595fa8714df6c2 Mon Sep 17 00:00:00 2001 From: themodernhakr Date: Sun, 23 Mar 2025 02:01:49 -0500 Subject: [PATCH] Add helper functions --- src/database/database.jmc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/database/database.jmc b/src/database/database.jmc index 83bc18a..c29411b 100644 --- a/src/database/database.jmc +++ b/src/database/database.jmc @@ -83,15 +83,16 @@ class database.benchmark { ::database.test.arrayTest2.array.del(); ::database.test.arrayTest2.index.del(); } + function arrayTest2._searchIndex() { + $::temp.index = ::database.test.arrayTest2.index.$(keyword); + tellraw @a {"nbt":"temp.index","storage":"ferdinland:ferdinland"}; + } + function arrayTest2._searchArray() { + $tellraw @a {"nbt":"database.test.arrayTest2.array.$(index)", "storage":"ferdinland:ferdinland"}; + } function arrayTest2.run() { - ::temp.keyword = "entry500"; - execute run { - $say "$(keyword)"; - $tellraw @a {"nbt":"database.test.arrayTest2.index.$(keyword)","storage":"ferdinland:ferdinland"}; - $::temp.index = ::database.test.arrayTest2.index.$(keyword); - tellraw @a {"nbt":"temp.index","storage":"ferdinland:ferdinland"}; - } with ::temp.keyword; - ::temp.keyword.del(); + this.arrayTest2._searchIndex({keyword: "entry500"}); + this.arrayTest2._searchArray() with ::temp.index; ::temp.index.del(); } }