From e9d84b53e7c54f84da64967faf36c8b2791579f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= Date: Thu, 18 Jul 2019 17:42:31 +0000 Subject: add inet.is_set() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Asbjørn Sloth Tønnesen --- lua/inet/set.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lua/inet/set.lua') 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 -- cgit v1.2.1