Global: optimises usage of FFstrbuf and FFlist

This commit is contained in:
李通洲
2026-01-09 16:18:25 +08:00
parent 1337525eb5
commit b065b3da51
6 changed files with 17 additions and 7 deletions
+7
View File
@@ -126,3 +126,10 @@ static inline void ffListClear(FFlist* list)
assert(sizeof(itemType) == (listVar).elementSize); \
(itemType*) ffListAdd(&(listVar)); \
})
#define FF_LIST_FIRST(itemType, listVar) FF_LIST_GET(itemType, listVar, 0)
#define FF_LIST_LAST(itemType, listVar) \
({ \
assert((listVar).length > 0); \
FF_LIST_GET(itemType, listVar, ((listVar).length - 1)); \
})