From 42de5594cd4ebde605e6f93a48a7e7c9ab60ace4 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 11 Mar 2024 16:12:07 -0400 Subject: Lua already has a conventional cheap test for empty table. --- indra/newview/scripts/lua/util.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/indra/newview/scripts/lua/util.lua b/indra/newview/scripts/lua/util.lua index bb8d492d12..898ddc58e3 100644 --- a/indra/newview/scripts/lua/util.lua +++ b/indra/newview/scripts/lua/util.lua @@ -4,10 +4,7 @@ local util = {} -- cheap test whether table t is empty function util.empty(t) - for _ in pairs(t) do - return false - end - return true + return not next(t) end -- reliable count of the number of entries in table t -- cgit v1.2.3