Permalink
Browse files

Make anti-duplicates actually work

  • Loading branch information...
o-jasper committed Oct 19, 2015
1 parent 10aa066 commit 3fadfd474a6b1096ccb242c1564baf6ded6fd881
Showing with 7 additions and 6 deletions.
  1. +7 −6 tox_comms/do/Tox/init.lua
View
@@ -17,6 +17,7 @@ This.__index = This
local function addr_fix(self, addr)
if self.overriding_addr[addr] then
assert(#addr > 64)
return self.overriding_addr[addr]
elseif #addr > 64 then
local s_addr = string.sub(addr, 1, 64)
@@ -27,12 +28,12 @@ local function addr_fix(self, addr)
if got then
edges[addr] = got
edges[s_addr] = nil
for _, edge in pairs(edges) do
local got = edge[s_addr]
if got then
edge[addr] = got
edge[s_addr] = nil
end
end
for _, edge in pairs(edges) do
local got = edge[s_addr]
if got then
edge[addr] = got
edge[s_addr] = nil
end
end
return addr

0 comments on commit 3fadfd4

Please sign in to comment.