/** * iterates through all the edges in the graph and removes any that point * to an invalidated node */ private void CullInvalidEdges() { foreach (EdgeList EL in edges) { var node = EL.First; while (node != null) { var next = node.Next; if (Nodes[node.Value.to].index == NT.INVALID_NODE_INDEX || Nodes[node.Value.from].index == NT.INVALID_NODE_INDEX) { EL.Remove(node); } node = next; } } }