]> git.itanic.dy.fi Git - sdl-planets/commitdiff
quadtree: Remove redundant validity test
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Wed, 13 Jul 2011 16:43:10 +0000 (19:43 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Wed, 13 Jul 2011 17:05:06 +0000 (20:05 +0300)
The sole purpose of this test wast to see whether the subtree was
removed correctly. If such condition exists, the failure will be
caught in the quadtree_del function. This test should be removed since
it causes unnecessary runtime overhead also on the non-debug build.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
quadtree.c

index 5ea460a397ee5a0dabee3fbdeca06d5f58c8554f..30e306ed58983d70a371e2007063cb6bfc6332f8 100644 (file)
@@ -622,11 +622,6 @@ static int optimally_move_tree(struct quadtree *tree, struct quadtree *parent,
        if (quadtree_split_by_node(t, corner, QUADTREE_DOWNRIGHT))
                moved += optimally_move_tree(tree, parent, corner, ops);
 
-       get_middle_point(corner_orig, &mid);
-       tmp = quadtree_find_nearest(tree, &mid, corner_orig, NULL, 0);
-       if (tmp && tmp != tree)
-               trap();
-
 out:
        if (debug)
                printf("Now moved %d nodes, %ld left\n", moved, tree->children);