aboutsummaryrefslogtreecommitdiffstats
path: root/src/ClientProcess.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-04 01:17:25 +0100
committerMax Kellermann <max@duempel.org>2013-01-04 01:17:25 +0100
commita7d1daee93446327b5a0c35d779880354cdbf66e (patch)
treecbf9c8013495c871474dc405e513e914dde0f151 /src/ClientProcess.cxx
parent77a99cc61d7a39745192354594086bb90ffb0b50 (diff)
downloadmpd-a7d1daee93446327b5a0c35d779880354cdbf66e.tar.gz
mpd-a7d1daee93446327b5a0c35d779880354cdbf66e.tar.xz
mpd-a7d1daee93446327b5a0c35d779880354cdbf66e.zip
CommandListBuilder: use std::list instead of GSList
Diffstat (limited to '')
-rw-r--r--src/ClientProcess.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ClientProcess.cxx b/src/ClientProcess.cxx
index 9d3716029..69b23e868 100644
--- a/src/ClientProcess.cxx
+++ b/src/ClientProcess.cxx
@@ -29,13 +29,14 @@
#define CLIENT_LIST_MODE_END "command_list_end"
static enum command_return
-client_process_command_list(Client *client, bool list_ok, GSList *list)
+client_process_command_list(Client *client, bool list_ok,
+ std::list<std::string> &&list)
{
enum command_return ret = COMMAND_RETURN_OK;
unsigned num = 0;
- for (GSList *cur = list; cur != NULL; cur = g_slist_next(cur)) {
- char *cmd = (char *)cur->data;
+ for (auto &&i : list) {
+ char *cmd = &*i.begin();
g_debug("command_process_list: process command \"%s\"",
cmd);
@@ -81,11 +82,11 @@ client_process_line(Client *client, char *line)
g_debug("[%u] process command list",
client->num);
- auto cmd_list = client->cmd_list.Commit();
+ auto &&cmd_list = client->cmd_list.Commit();
ret = client_process_command_list(client,
client->cmd_list.IsOKMode(),
- cmd_list);
+ std::move(cmd_list));
g_debug("[%u] process command "
"list returned %i", client->num, ret);