]> git.itanic.dy.fi Git - sdl-planets/commitdiff
quadtree: Only use the validator when debugging is enabled
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Mon, 5 Apr 2010 13:00:48 +0000 (16:00 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Mon, 5 Apr 2010 13:04:26 +0000 (16:04 +0300)
quadtree.c

index 94a37c1775f438bbc0e44bbc1fafc402c5dc480d..b173c3e933334dc98b161156489f610a26b5c6a3 100644 (file)
@@ -2,9 +2,16 @@
 
 #include "quadtree.h"
 
-void trap(void )
+#ifdef DEBUG
+#define debug 1
+#else
+#define debug 0
+#endif
+
+static void trap(void )
 {
-       exit(1);
+       if (debug)
+               exit(1);
 }
 
 static void validate_subtree(const struct quadtree *node)
@@ -38,7 +45,8 @@ static void validate_tree(const struct quadtree *node)
 {
        const struct quadtree *parent = quadtree_find_parent(node);
 
-       validate_subtree(parent);
+       if (debug)
+               validate_subtree(parent);
 }
 
 /**