From: Aurelien DARRAGON Date: Wed, 10 May 2023 17:59:35 +0000 (+0200) Subject: CLEANUP: hlua_fcn/queue: make queue:push() easier to read X-Git-Tag: v2.8-dev12~79 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d7d507aa8a6fcfe1518d68d5c8f8330d7ecd0130;p=thirdparty%2Fhaproxy.git CLEANUP: hlua_fcn/queue: make queue:push() easier to read Adding some spaces and code comments in queue:push() function to make it easier to read. --- diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c index 3347211d05..a92daa3b03 100644 --- a/src/hlua_fcn.c +++ b/src/hlua_fcn.c @@ -564,12 +564,18 @@ static int hlua_queue_push(lua_State *L) return 0; } BUG_ON(!queue); + item = pool_alloc(pool_head_hlua_queue); if (!item) { + /* memory error */ lua_pushboolean(L, 0); return 1; } + + /* get a reference from lua object at the top of the stack */ item->ref = hlua_ref(L); + + /* push new entry to the queue */ MT_LIST_INIT(&item->list); HA_ATOMIC_INC(&queue->size); MT_LIST_APPEND(&queue->list, &item->list);