From 90f9766a87ca73a4d171fb88c3ace53c3b2f74b5 Mon Sep 17 00:00:00 2001 From: Antonio Carzaniga Date: Wed, 21 Aug 2019 10:26:58 +0200 Subject: [PATCH] other minor simplifications. --- balls.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/balls.c b/balls.c index 6142e0b..2295be4 100644 --- a/balls.c +++ b/balls.c @@ -231,7 +231,7 @@ void c_index_build() { struct bt_node ** c_index_stack = 0; unsigned int c_index_stack_top = 0; -void c_index_stack_clear() { +static void c_index_stack_clear() { c_index_stack_top = 0; } @@ -264,9 +264,8 @@ void c_index_check_collisions() { do { ball_collision(n->ball, b); if (c_index_must_check(n->left, b)) { - if (c_index_must_check(n->right, b)) { + if (c_index_must_check(n->right, b)) c_index_stack_push(n->right); - } n = n->left; } else if (c_index_must_check(n->right, b)) { n = n->right;