From f07c01b1930bcea4abd2fde45abcd0c903ec3a61 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Wed, 13 Jul 2011 19:53:08 +0300 Subject: [PATCH] quadtree: Unlink parent when rebalancing a subtree There is no need to keep the one way link to the parent while the subtree is being rebalanced. Removing this link optimizes the rebalancing process by stopping the stats recalculation from propagating into the parent tree. Signed-off-by: Timo Kokkonen --- quadtree.c | 1 + 1 file changed, 1 insertion(+) diff --git a/quadtree.c b/quadtree.c index 30e306e..1cb9756 100644 --- a/quadtree.c +++ b/quadtree.c @@ -688,6 +688,7 @@ struct quadtree *quadtree_del(struct quadtree *node, trap(); parent = node->parent; + node->parent = NULL; /* * The sub branch is now detached from the main -- 2.45.0