diff options
author | Kim Alvefur <zash@zash.se> | 2017-12-01 01:55:15 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-12-01 01:55:15 +0100 |
commit | af801d58cb6a0be6d18805e919fd958054b8bc9f (patch) | |
tree | 7318399b7567ccad27e3d7d4f1cc353e500a200d /util/ip.lua | |
parent | c8323e953da67ee363bc6eac02a5be49239db97f (diff) | |
download | prosody-af801d58cb6a0be6d18805e919fd958054b8bc9f.tar.gz prosody-af801d58cb6a0be6d18805e919fd958054b8bc9f.zip |
util.ip: Reflow metatable
Diffstat (limited to 'util/ip.lua')
-rw-r--r-- | util/ip.lua | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/util/ip.lua b/util/ip.lua index 4526ae76..19be7013 100644 --- a/util/ip.lua +++ b/util/ip.lua @@ -6,9 +6,15 @@ -- local ip_methods = {}; -local ip_mt = { __index = function (ip, key) return (ip_methods[key])(ip); end, - __tostring = function (ip) return ip.addr; end, - __eq = function (ipA, ipB) return ipA.addr == ipB.addr; end}; + +local ip_mt = { + __index = function (ip, key) + return ip_methods[key](ip); + end, + __tostring = function (ip) return ip.addr; end, + __eq = function (ipA, ipB) return ipA.addr == ipB.addr; end +}; + local hex2bits = { ["0"] = "0000", ["1"] = "0001", ["2"] = "0010", ["3"] = "0011", ["4"] = "0100", ["5"] = "0101", ["6"] = "0110", ["7"] = "0111", |