]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: hlua_fcn/queue: make queue:push() easier to read
authorAurelien DARRAGON <adarragon@haproxy.com>
Wed, 10 May 2023 17:59:35 +0000 (19:59 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 11 May 2023 07:23:14 +0000 (09:23 +0200)
Adding some spaces and code comments in queue:push() function to make
it easier to read.

src/hlua_fcn.c

index 3347211d059205e5ad5d01e103ad8b2d8d848c03..a92daa3b03e5bcc158a7ce4a50560221fef25166 100644 (file)
@@ -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);