diff options
-rw-r--r-- | rcynic/rcynic.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/rcynic/rcynic.c b/rcynic/rcynic.c index c4eaf57c..fd1f7c11 100644 --- a/rcynic/rcynic.c +++ b/rcynic/rcynic.c @@ -1409,13 +1409,10 @@ validation_status_find(validation_status_t *node, { int cmp; - while (node != NULL) - if ((cmp = validation_status_cmp(node, uri, generation)) == 0) - return node; - else - node = cmp < 0 ? node->left_child : node->right_child; + while (node != NULL && (cmp = validation_status_cmp(node, uri, generation)) != 0) + node = cmp < 0 ? node->left_child : node->right_child; - return NULL; + return node; } /** |