MINOR: pattern: perform a single call to pat_delete_gen() under the expression
When we're removing an element under the expression lock, we don't need
anymore to run over all ->delete() functions via the expressions, since
we know that the single function does it fine now. Note that at this
point, pattern->delete() is not used at all through out the code anymore.
diff --git a/src/pattern.c b/src/pattern.c
index 0a2032e..89a5c48 100644
--- a/src/pattern.c
+++ b/src/pattern.c
@@ -1527,11 +1527,11 @@
bref->ref = elt->list.n;
}
+ /* delete all entries from all expressions for this pattern */
list_for_each_entry(expr, &ref->pat, list)
HA_RWLOCK_WRLOCK(PATEXP_LOCK, &expr->lock);
- list_for_each_entry(expr, &ref->pat, list)
- expr->pat_head->delete(expr->ref, elt);
+ pat_delete_gen(ref, elt);
list_for_each_entry(expr, &ref->pat, list)
HA_RWLOCK_WRUNLOCK(PATEXP_LOCK, &expr->lock);
@@ -1577,8 +1577,7 @@
list_for_each_entry(expr, &ref->pat, list)
HA_RWLOCK_WRLOCK(PATEXP_LOCK, &expr->lock);
- list_for_each_entry(expr, &ref->pat, list)
- expr->pat_head->delete(expr->ref, elt);
+ pat_delete_gen(ref, elt);
list_for_each_entry(expr, &ref->pat, list)
HA_RWLOCK_WRUNLOCK(PATEXP_LOCK, &expr->lock);