From 1c3095f6ddbbbe78a9d2b8ec41d3c163ad449990 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Sun, 21 Nov 2021 20:11:28 -0800 Subject: [PATCH] Remove extra indentation level --- CLI/Web.cpp | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/CLI/Web.cpp b/CLI/Web.cpp index d1da4aed..cf5c831e 100644 --- a/CLI/Web.cpp +++ b/CLI/Web.cpp @@ -79,31 +79,28 @@ static std::string runCode(lua_State* L, const std::string& source) return std::string(); } -extern "C" +extern "C" const char* executeScript(const char* source) { - const char* executeScript(const char* source) - { - // setup flags - for (Luau::FValue* flag = Luau::FValue::list; flag; flag = flag->next) - if (strncmp(flag->name, "Luau", 4) == 0) - flag->value = true; + // setup flags + for (Luau::FValue* flag = Luau::FValue::list; flag; flag = flag->next) + if (strncmp(flag->name, "Luau", 4) == 0) + flag->value = true; - // create new state - std::unique_ptr globalState(luaL_newstate(), lua_close); - lua_State* L = globalState.get(); + // create new state + std::unique_ptr globalState(luaL_newstate(), lua_close); + lua_State* L = globalState.get(); - // setup state - setupState(L); + // setup state + setupState(L); - // sandbox thread - luaL_sandboxthread(L); + // sandbox thread + luaL_sandboxthread(L); - // static string for caching result (prevents dangling ptr on function exit) - static std::string result; + // static string for caching result (prevents dangling ptr on function exit) + static std::string result; - // run code + collect error - result = runCode(L, source); + // run code + collect error + result = runCode(L, source); - return result.empty() ? NULL : result.c_str(); - } + return result.empty() ? NULL : result.c_str(); }