client/Process: reset the CommandListBuilder before processing it
Allows removing a CommandResult::CLOSE check.
This commit is contained in:
parent
7d1db5c19f
commit
c1272c72b0
@ -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)) {
|
||||
|
@ -97,7 +97,7 @@ public:
|
||||
/**
|
||||
* Finishes the list and returns it.
|
||||
*/
|
||||
std::list<std::string> &&Commit() {
|
||||
std::list<std::string> Commit() {
|
||||
assert(IsActive());
|
||||
|
||||
return std::move(list);
|
||||
|
Loading…
Reference in New Issue
Block a user