From a3018c2a31b9ccb9b347cd91777c10368b6ddb27 Mon Sep 17 00:00:00 2001 From: cron Date: Sun, 22 Nov 2020 06:52:20 +0000 Subject: [PATCH] turtle/tlang: improve in_keys() The function references should probably be replaced with the Lua-y form --- clientmods/turtle/tlang_vm.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/clientmods/turtle/tlang_vm.lua b/clientmods/turtle/tlang_vm.lua index 388a97299..d17ca769f 100644 --- a/clientmods/turtle/tlang_vm.lua +++ b/clientmods/turtle/tlang_vm.lua @@ -12,12 +12,7 @@ local function in_list(value, list) end local function in_keys(value, list) - for k, v in pairs(list) do - if k == value then - return true - end - end - return false + return list[value] ~= nil end -- state