fix: list function should skip over empty pools

This commit is contained in:
ngn
2024-08-22 02:54:48 +03:00
parent af904e1119
commit a0d7e03f2e
2 changed files with 9 additions and 4 deletions

View File

@ -41,9 +41,14 @@ lm_pkg_t *lm_ctx_list_next(lm_ctx_list_t *list){
return list->pkg;
}
if((list->pkg = list->pkg->next) && NULL == list->pkg){
if((list->pool = list->pool->next) != NULL)
list->pkg = list->pool->pkg;
if((list->pkg = list->pkg->next) == NULL){
next_pool:
if((list->pool = list->pool->next) == NULL)
return list->pkg;
if((list->pkg = list->pool->pkg) == NULL)
goto next_pool;
return list->pkg;
}