local function uniqueE(edges)
local Unique={}
for i,edge in pairs(edges) do
local IsUnique = true
for j,otherEdge in pairs(edges) do
if compareE(edge,otherEdge) and i~=j then
IsUnique=false
break
end
end
if IsUnique then
table.insert(Unique,edge)
end
end
return Unique
end
the function is currently O(n^2) , which is expensive for the thing im trying to do , is there a way i can make it detect duplicate edges without using a nested loop?