From f54b6959ab275626d7b60ecb0dd0d70fb3ecd3a2 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Fri, 3 May 2024 11:53:09 +0200 Subject: [PATCH] tagged_cmd use `const string &` --- src/command.cpp | 2 +- src/command.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/command.cpp b/src/command.cpp index 1d1dd2a94..a03818fec 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -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.]" + cmd; diff --git a/src/command.h b/src/command.h index 2abb27460..d5a3d3854 100644 --- a/src/command.h +++ b/src/command.h @@ -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);