diff options
Diffstat (limited to 'lua/inet/core.lua')
-rw-r--r-- | lua/inet/core.lua | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lua/inet/core.lua b/lua/inet/core.lua index 4a5e14f..f9ff6e1 100644 --- a/lua/inet/core.lua +++ b/lua/inet/core.lua @@ -1,5 +1,7 @@ local bit32 = require 'bit32' +local common = require 'inet.common' + local format = string.format local lshift = bit32.lshift @@ -8,6 +10,8 @@ local band = bit32.band local replace = bit32.replace local bxor = bit32.bxor +local get_mt = common.get_mt + local mt2fam = {} local inet = {} @@ -21,11 +25,6 @@ local inet6 = setmetatable({}, inet) inet6.__index = inet6 mt2fam[inet6] = 6 -local function get_mt(t) - if type(t) ~= 'table' then return nil end - return getmetatable(t) -end - local function is_inet4(t) local mt = get_mt(t) return mt == inet4 |