From db72d255b0ee274b4a3d8802b6555afa792f3e1d Mon Sep 17 00:00:00 2001 From: Ukendio Date: Mon, 29 Jul 2024 14:12:57 +0200 Subject: [PATCH] Return static function --- example/src/shared/common.luau | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/example/src/shared/common.luau b/example/src/shared/common.luau index 1842550..bb4bcbe 100644 --- a/example/src/shared/common.luau +++ b/example/src/shared/common.luau @@ -18,16 +18,20 @@ do local w local dt local systemsNames + local system - local function run(system) + local function profile() local name = systemsNames[system] - return function() - debug.profilebegin(name) - debug.setmemorycategory(name) - system(w, dt) - debug.profileend() - end + debug.profilebegin(name) + debug.setmemorycategory(name) + system(w, dt) + debug.profileend() + end + + local function run(sys) + system = sys + return profile end local function loop(sinceLastFrame) @@ -55,9 +59,9 @@ do .. debug.info(system, "n") .. " has been ejected" ) - continue + else + LOOP_ERROR(why) end - LOOP_ERROR(why) end debug.profileend()