CLEANUP: patterns: remove dead code

Situations where we are iterating over elements and find one with a
different generation ID cannot arise anymore since the elements are kept
per-generation.
This commit is contained in:
Maxime Henrion 2025-12-23 10:57:22 -05:00 committed by Willy Tarreau
parent 545cf59b6f
commit 99e625a41d
2 changed files with 0 additions and 21 deletions

View File

@ -3047,7 +3047,6 @@ static int _hlua_listable_patref_pairs_iterator(lua_State *L, int status, lua_KC
int context_index;
struct hlua_patref_iterator_context *hctx;
struct pat_ref_elt *elt;
int cnt = 0;
unsigned int curr_gen;
context_index = lua_upvalueindex(1);
@ -3078,23 +3077,6 @@ static int _hlua_listable_patref_pairs_iterator(lua_State *L, int status, lua_KC
elt = LIST_ELEM(hctx->bref.ref, struct pat_ref_elt *, list);
if (elt->gen_id != curr_gen) {
/* check if we may do something to try to prevent thread contention,
* unless we run from body/init state where hlua_yieldk is no-op
*/
if (cnt > 10000 && hlua_gethlua(L)) {
/* let's yield and wait for being called again to continue where we left off */
LIST_APPEND(&elt->back_refs, &hctx->bref.users);
HA_RWLOCK_WRUNLOCK(PATREF_LOCK, &hctx->ref->ptr->lock);
hlua_yieldk(L, 0, 0, _hlua_listable_patref_pairs_iterator, TICK_ETERNITY, HLUA_CTRLYIELD); // continue
return 0; // not reached
}
hctx->bref.ref = elt->list.n;
cnt++;
goto next;
}
LIST_APPEND(&elt->back_refs, &hctx->bref.users);
HA_RWLOCK_WRUNLOCK(PATREF_LOCK, &hctx->ref->ptr->lock);

View File

@ -402,9 +402,6 @@ static int cli_io_handler_pat_list(struct appctx *appctx)
elt = LIST_ELEM(ctx->bref.ref, struct pat_ref_elt *, list);
if (elt->gen_id != ctx->curr_gen)
goto skip;
/* build messages */
if (elt->sample)
chunk_appendf(&trash, "%p %s %s\n",