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:
Jan Vidar Krey
2013-03-22 20:00:40 +01:00
parent b81bb2cbd9
commit 2d6f69d299
8 changed files with 170 additions and 24 deletions

View File

@@ -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);
}
}