From 020534d6f79eaeef11eaeb8ac771fbaa42b43dbd Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sun, 16 May 2010 21:45:45 +0200 Subject: [PATCH] [CLEANUP] acl: make use of eb_is_empty() instead of open coding the tree's emptiness test Since ebtree 6.0.1, we now have eb_is_empty() which is cleaner and safer to use than checking the left pointer of the tree, so let's use that. --- src/acl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/acl.c b/src/acl.c index adf44941c..bdd12045c 100644 --- a/src/acl.c +++ b/src/acl.c @@ -1315,7 +1315,7 @@ int acl_exec_cond(struct acl_cond *cond, struct proxy *px, struct session *l4, v acl_res |= ACL_PAT_FAIL; } else { - if (expr->pattern_tree.b[EB_LEFT]) { + if (!eb_is_empty(&expr->pattern_tree)) { /* a tree is present, let's check what type it is */ if (expr->kw->match == acl_match_str) acl_res |= acl_lookup_str(&test, expr) ? ACL_PAT_PASS : ACL_PAT_FAIL; @@ -1331,7 +1331,7 @@ int acl_exec_cond(struct acl_cond *cond, struct proxy *px, struct session *l4, v } if ((test.flags & ACL_TEST_F_NULL_MATCH) && - LIST_ISEMPTY(&expr->patterns) && !expr->pattern_tree.b[EB_LEFT]) + LIST_ISEMPTY(&expr->patterns) && eb_is_empty(&expr->pattern_tree)) acl_res |= expr->kw->match(&test, NULL); } /*