From a4c975abc34beac6728c00f3e5ad88c9cd4cb3d7 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 1 Dec 2017 01:55:15 +0100 Subject: util.ip: Reflow metatable --- util/ip.lua | 12 +++++++++--- 1 file 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", -- cgit v1.2.3