diff options
author | Asbjørn Sloth Tønnesen <ast@2e8.dk> | 2019-07-18 17:42:31 +0000 |
---|---|---|
committer | Asbjørn Sloth Tønnesen <ast@2e8.dk> | 2019-07-18 17:42:31 +0000 |
commit | e9d84b53e7c54f84da64967faf36c8b2791579f4 (patch) | |
tree | 077c6d41d59402a929aba22ba8510047a96205d5 /lua/inet/set.lua | |
parent | 54251356a23468136f6226134b0f8524a6ae3523 (diff) | |
download | lua-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.lua | 7 |
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 |