From: Timo Kokkonen Date: Wed, 13 Jul 2011 16:53:08 +0000 (+0300) Subject: quadtree: Unlink parent when rebalancing a subtree X-Git-Url: http://git.itanic.dy.fi/?p=sdl-planets;a=commitdiff_plain;h=f07c01b1930bcea4abd2fde45abcd0c903ec3a61 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 --- 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