Add list_remove function

This commit is contained in:
Abdelrahman Said 2024-07-14 16:02:19 +01:00
parent 83fa308a4b
commit 5a3b143762

View File

@ -44,6 +44,10 @@
LP->items[(LP->count)++] = ITEM; \
} while (0)
#define list_remove(LP, IDX) \
do { \
LP->items[IDX] = LP->items[(LP->count)--]; \
} while (0)
#define list_pop(LP) (LP->count -= 1)
#define list_get(LP, IDX) LP->items[IDX]