fix near constant removal

This commit is contained in:
Júlio César Batista 2023-02-18 12:20:47 -03:00
parent 8105f02dc7
commit 4b9fc8f7a1
No known key found for this signature in database
GPG key ID: 10C4B861BF314878

View file

@ -98,7 +98,7 @@ func WithoutConstantNears(ctx context.Context, g *d2graph.Graph) (nears []*d2gra
nears = append(nears, obj)
g.Objects = append(g.Objects[:i], g.Objects[i+1:]...)
i--
delete(obj.Parent.Children, obj.ID)
delete(obj.Parent.Children, strings.ToLower(obj.ID))
for i := 0; i < len(obj.Parent.ChildrenArray); i++ {
if obj.Parent.ChildrenArray[i] == obj {
obj.Parent.ChildrenArray = append(obj.Parent.ChildrenArray[:i], obj.Parent.ChildrenArray[i+1:]...)