Skip to content

Commit

Permalink
[commands] ProxyCommand: Use inner command name in unique_ptr constru…
Browse files Browse the repository at this point in the history
  • Loading branch information
rzblue authored Aug 30, 2023
1 parent cf19102 commit 3c04580
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ ProxyCommand::ProxyCommand(Command* command)
SetName(std::string{"Proxy("}.append(command->GetName()).append(")"));
}

ProxyCommand::ProxyCommand(std::unique_ptr<Command> command)
: ProxyCommand([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 3c04580

Please sign in to comment.