Skip to content

Commit

Permalink
Move supplier construction to ctor body
Browse files Browse the repository at this point in the history
  • Loading branch information
rzblue committed Aug 29, 2023
1 parent 27fbaae commit dea86e8
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ ProxyCommand::ProxyCommand(Command* command)
SetName(std::string{"Proxy("}.append(command->GetName()).append(")"));
}

ProxyCommand::ProxyCommand(std::unique_ptr<Command> command)
: m_supplier((
SetName(std::string{"Proxy("}.append(command->GetName()).append(")")),
[command = std::move(command)] { return command.get(); })) {}
ProxyCommand::ProxyCommand(std::unique_ptr<Command> command) {
SetName(std::string{"Proxy("}.append(command->GetName()).append(")"));
m_supplier = [command = std::move(command)] { return command.get(); };
}

void ProxyCommand::Initialize() {
m_command = m_supplier();
Expand Down

0 comments on commit dea86e8

Please sign in to comment.