summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua/util.lua
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/scripts/lua/util.lua')
-rw-r--r--indra/newview/scripts/lua/util.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/indra/newview/scripts/lua/util.lua b/indra/newview/scripts/lua/util.lua
index e3af633ea7..a2191288f6 100644
--- a/indra/newview/scripts/lua/util.lua
+++ b/indra/newview/scripts/lua/util.lua
@@ -2,9 +2,9 @@
local util = {}
--- cheap test whether table t is empty
-function util.empty(t)
- return not next(t)
+-- check if array-like table contains certain value
+function util.contains(t, v)
+ return table.find(t, v) ~= nil
end
-- reliable count of the number of entries in table t
@@ -17,6 +17,11 @@ function util.count(t)
return count
end
+-- cheap test whether table t is empty
+function util.empty(t)
+ return not next(t)
+end
+
-- recursive table equality
function util.equal(t1, t2)
if not (type(t1) == 'table' and type(t2) == 'table') then