From 4e88f399ebd43e1fc37120b4962b6aefbfc4e96d Mon Sep 17 00:00:00 2001 From: FutureRave Date: Fri, 12 Nov 2021 19:26:19 +0000 Subject: [PATCH 1/2] [Command] Use std::format --- src/client/component/command.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/client/component/command.cpp b/src/client/component/command.cpp index e88e05c..c105443 100644 --- a/src/client/component/command.cpp +++ b/src/client/component/command.cpp @@ -308,11 +308,8 @@ namespace command { if (!filename.empty()) { - //It's 10.2020 and still no std:format in vs :< - std::string line = dvar->name; - line.append("\""); - line.append(game::Dvar_ValueToString(dvar, dvar->current)); - line.append("\"\r\n"); + const auto line = std::format("{} \"{}\"\r\n", dvar->name, + game::Dvar_ValueToString(dvar, dvar->current)); utils::io::write_file(filename, line, i != 0); } console::info("%s \"%s\"\n", dvar->name, @@ -344,9 +341,7 @@ namespace command { if (!filename.empty()) { - //It's 10.2020 and still no std:format in vs :< - std::string line = cmd->name; - line.append("\r\n"); + const auto line = std::format("{}\r\n", cmd->name); utils::io::write_file(filename, line, i != 0); } console::info("%s\n", cmd->name); From cdc44e8cc82570d93a455072d24c053161a1d8ee Mon Sep 17 00:00:00 2001 From: FutureRave Date: Fri, 12 Nov 2021 19:28:34 +0000 Subject: [PATCH 2/2] [Command] Tabbed a bit too much --- src/client/component/command.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/component/command.cpp b/src/client/component/command.cpp index c105443..860b0f4 100644 --- a/src/client/component/command.cpp +++ b/src/client/component/command.cpp @@ -309,7 +309,7 @@ namespace command if (!filename.empty()) { const auto line = std::format("{} \"{}\"\r\n", dvar->name, - game::Dvar_ValueToString(dvar, dvar->current)); + game::Dvar_ValueToString(dvar, dvar->current)); utils::io::write_file(filename, line, i != 0); } console::info("%s \"%s\"\n", dvar->name,