Add list_remove function
This commit is contained in:
parent
83fa308a4b
commit
5a3b143762
@ -44,6 +44,10 @@
|
|||||||
LP->items[(LP->count)++] = ITEM; \
|
LP->items[(LP->count)++] = ITEM; \
|
||||||
} while (0)
|
} 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_pop(LP) (LP->count -= 1)
|
||||||
|
|
||||||
#define list_get(LP, IDX) LP->items[IDX]
|
#define list_get(LP, IDX) LP->items[IDX]
|
||||||
|
Loading…
Reference in New Issue
Block a user