]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[CLEANUP] acl: make use of eb_is_empty() instead of open coding the tree's emptiness...
authorWilly Tarreau <w@1wt.eu>
Sun, 16 May 2010 19:45:45 +0000 (21:45 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 16 May 2010 19:45:45 +0000 (21:45 +0200)
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

index adf44941cbb6cde46224dc1c7ff33d0bed8455ca..bdd12045c814146fefa97deef94b362119877aca 100644 (file)
--- 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);
                                }
                                /*