tagged_cmd use const string &

This commit is contained in:
MichaelDvP
2024-05-03 11:53:09 +02:00
parent 1fa6da8eff
commit f54b6959ab
2 changed files with 2 additions and 2 deletions

View File

@@ -453,7 +453,7 @@ void Command::erase_command(const uint8_t device_type, const char * cmd, uint8_t
}
// get the tagged command
std::string Command::tagged_cmd(std::string cmd, const uint8_t flag) {
std::string Command::tagged_cmd(const std::string & cmd, const uint8_t flag) {
switch (flag & 0x3F) {
case CommandFlag::CMD_FLAG_HC:
return "[hc<n>.]" + cmd;

View File

@@ -124,7 +124,7 @@ class Command {
static void show_all(uuid::console::Shell & shell);
static Command::CmdFunction * find_command(const uint8_t device_type, const uint8_t device_id, const char * cmd, const uint8_t flag);
static std::string tagged_cmd(std::string cmd, const uint8_t flag);
static std::string tagged_cmd(const std::string & cmd, const uint8_t flag);
static void erase_command(const uint8_t device_type, const char * cmd, uint8_t flag = CommandFlag::CMD_FLAG_DEFAULT);
static void show(uuid::console::Shell & shell, uint8_t device_type, bool verbose);