Cleaned up usage of linked lists and added missing functionality.
- Added a list_remove_first() which is generally better than list_remove() provided you want to remove the first element. - Added a list_append_list() to append and move all nodes from one list to another.
This commit is contained in:
@@ -1320,9 +1320,7 @@ void hub_logout_log(struct hub_info* hub, struct hub_user* user)
|
||||
list_append(hub->logout_info, loginfo);
|
||||
while (list_size(hub->logout_info) > (size_t) hub->config->max_logout_log)
|
||||
{
|
||||
struct hub_logout_info* entry = list_get_first(hub->logout_info);
|
||||
list_remove(hub->logout_info, entry);
|
||||
hub_free(entry);
|
||||
list_remove_first(hub->logout_info, hub_free);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user