From a7d1daee93446327b5a0c35d779880354cdbf66e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 4 Jan 2013 01:17:25 +0100 Subject: CommandListBuilder: use std::list instead of GSList --- src/CommandListBuilder.cxx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/CommandListBuilder.cxx') diff --git a/src/CommandListBuilder.cxx b/src/CommandListBuilder.cxx index 55b82a23..e58afccd 100644 --- a/src/CommandListBuilder.cxx +++ b/src/CommandListBuilder.cxx @@ -25,12 +25,7 @@ void CommandListBuilder::Reset() { - for (GSList *tmp = list; tmp != NULL; tmp = g_slist_next(tmp)) - g_free(tmp->data); - - g_slist_free(list); - - list = nullptr; + list.clear(); mode = Mode::DISABLED; } @@ -42,6 +37,6 @@ CommandListBuilder::Add(const char *cmd) if (size > client_max_command_list_size) return false; - list = g_slist_prepend(list, g_strdup(cmd)); + list.emplace_back(cmd); return true; } -- cgit v1.2.3