From 08d22ebcd6ce530a10a372e12b3f7d7751655896 Mon Sep 17 00:00:00 2001 From: Georg Hopp Date: Tue, 24 Jun 2014 16:25:42 +0100 Subject: [PATCH] small fix in tree find --- include/tr/tree_macros.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/tr/tree_macros.h b/include/tr/tree_macros.h index 0cfee33..540ce58 100644 --- a/include/tr/tree_macros.h +++ b/include/tr/tree_macros.h @@ -116,12 +116,11 @@ typedef enum {rbBlack=1, rbRed=2} TR_rbColor; while(1) { \ (found) = (comp)((node)->data, (search)); \ if (0 != (found)) { \ - if (! ((node)->left || (node)->right)) { \ - break; \ - } \ if (0 < (found)) { \ + if (! (node)->left) break; \ (node) = (node)->left; \ } else { \ + if (! (node)->right) break; \ (node) = (node)->right; \ } \ } else { \