aboutsummaryrefslogtreecommitdiffstats
path: root/lua/inet/set.lua
diff options
context:
space:
mode:
authorAsbjørn Sloth Tønnesen <ast@2e8.dk>2019-07-18 17:42:31 +0000
committerAsbjørn Sloth Tønnesen <ast@2e8.dk>2019-07-18 17:42:31 +0000
commite9d84b53e7c54f84da64967faf36c8b2791579f4 (patch)
tree077c6d41d59402a929aba22ba8510047a96205d5 /lua/inet/set.lua
parent54251356a23468136f6226134b0f8524a6ae3523 (diff)
downloadlua-inet-e9d84b53e7c54f84da64967faf36c8b2791579f4.tar.gz
lua-inet-e9d84b53e7c54f84da64967faf36c8b2791579f4.tar.xz
lua-inet-e9d84b53e7c54f84da64967faf36c8b2791579f4.zip
add inet.is_set()
Signed-off-by: Asbjørn Sloth Tønnesen <ast@2e8.dk>
Diffstat (limited to 'lua/inet/set.lua')
-rw-r--r--lua/inet/set.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/lua/inet/set.lua b/lua/inet/set.lua
index a353f30..a5d9056 100644
--- a/lua/inet/set.lua
+++ b/lua/inet/set.lua
@@ -1,6 +1,8 @@
local core = require 'inet.core'
+local common = require 'inet.common'
local is_inet = core.is_inet
+local get_mt = common.get_mt
local insert = table.insert
local remove = table.remove
@@ -197,4 +199,9 @@ end
M.new = new_set
+function M.is_set(t)
+ local mt = get_mt(t)
+ return mt == inet_set
+end
+
return M