diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-09-08 20:14:16 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-09-08 20:14:16 +0200 |
commit | 5e8856790c50c30ea208e5cd28021818e5f2fcbf (patch) | |
tree | 2afe9f724865459c27c86ac3fdfd48503519cd96 /lib/graph.c | |
parent | lib: Fix deduplication bug, reinstate graph print (diff) | |
download | frr-5e8856790c50c30ea208e5cd28021818e5f2fcbf.tar.xz frr-5e8856790c50c30ea208e5cd28021818e5f2fcbf.zip |
lib: Remove automatic node deletion
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/graph.c')
-rw-r--r-- | lib/graph.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/graph.c b/lib/graph.c index be7d5aef3..314cf8685 100644 --- a/lib/graph.c +++ b/lib/graph.c @@ -65,12 +65,6 @@ graph_delete_node (struct graph *graph, struct graph_node *node) for (unsigned int j = 0; j < vector_active (adj->to); j++) if (vector_slot (adj->to, j) == node) vector_unset (adj->to, j); - - // if the node is orphaned, delete it - if (vector_active (adj->to) == 0 && - vector_active (adj->from) == 0 && - adj != node) - graph_delete_node (graph, adj); } // for all nodes that we have an edge to, remove us from their ->from @@ -80,15 +74,9 @@ graph_delete_node (struct graph *graph, struct graph_node *node) for (unsigned int j = 0; j < vector_active (adj->from); j++) if (vector_slot (adj->from, j) == node) vector_unset (adj->from, j); - - // if the node is orphaned, delete it - if (vector_active (adj->to) == 0 && - vector_active (adj->from) == 0 && - adj != node) - graph_delete_node (graph, adj); } - // if there is a deletion callback, call it! + // if there is a deletion callback, call it if (node->del && node->data) (*node->del) (node->data); |