summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-04-03 22:38:26 +0200
committerMax Kellermann <max@musicpd.org>2019-04-03 22:38:26 +0200
commitc1272c72b06cf80e43dcd94b3e765fef35e05f60 (patch)
tree7566e8074a5efc2b8b02c65bc4048e99a612367c /src/client
parent7d1db5c19f86b431e5614506576fc45f3a075a6b (diff)
client/Process: reset the CommandListBuilder before processing it
Allows removing a CommandResult::CLOSE check.
Diffstat (limited to 'src/client')
-rw-r--r--src/client/Process.cxx13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/client/Process.cxx b/src/client/Process.cxx
index cf6ed885b..7cd25348e 100644
--- a/src/client/Process.cxx
+++ b/src/client/Process.cxx
@@ -93,24 +93,19 @@ Client::ProcessLine(char *line) noexcept
"[%u] process command list",
num);
- auto &&list = cmd_list.Commit();
+ const bool ok_mode = cmd_list.IsOKMode();
+ auto list = cmd_list.Commit();
+ cmd_list.Reset();
- auto ret = ProcessCommandList(cmd_list.IsOKMode(),
+ auto ret = ProcessCommandList(ok_mode,
std::move(list));
FormatDebug(client_domain,
"[%u] process command "
"list returned %i", num, int(ret));
- if (ret == CommandResult::CLOSE)
- return CommandResult::CLOSE;
-
- assert(!IsExpired());
-
if (ret == CommandResult::OK)
command_success(*this);
- cmd_list.Reset();
-
return ret;
} else {
if (!cmd_list.Add(line)) {