aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorAsbjørn Sloth Tønnesen <ast@fiberby.net>2017-03-06 10:54:38 +0000
committerAsbjørn Sloth Tønnesen <ast@2e8.dk>2017-03-06 10:54:38 +0000
commita2216e14521763e702f69a9bfd046aa15a5b3f52 (patch)
tree2d676a793e27d66360b470223cc61d9d0ebd5dae /lua
parent57d276460839518fdecfcde16f256415417e0164 (diff)
downloadlua-inet-a2216e14521763e702f69a9bfd046aa15a5b3f52.tar.gz
lua-inet-a2216e14521763e702f69a9bfd046aa15a5b3f52.tar.xz
lua-inet-a2216e14521763e702f69a9bfd046aa15a5b3f52.zip
luacheck: clean up
Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Diffstat (limited to 'lua')
-rw-r--r--lua/inet/init.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/lua/inet/init.lua b/lua/inet/init.lua
index fcdabe9..99d1195 100644
--- a/lua/inet/init.lua
+++ b/lua/inet/init.lua
@@ -273,8 +273,7 @@ end
function inet6:is_balanced()
local pcs = self.pcs
- local i = 8
- for i=i,8 do
+ for i=1,8 do
local piece = pcs[i]
if piece < 0 or piece > 0xffff then
return false
@@ -453,7 +452,7 @@ function inet6:flip()
local flipbit = lshift(1, bitno)
local r = self:clone()
local val = r.pcs[block]
- r.pcs[block] = bxor(r.pcs[block], flipbit)
+ r.pcs[block] = bxor(val, flipbit)
--print(mask, block, maskbits, bitno, flipbit, self, r:balance())
return r
end