1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-16 00:42:45 +01:00

Codechange: Use emplace_back instead of push_back. (#13855)

This commit is contained in:
Peter Nelson
2025-03-20 17:39:10 +00:00
committed by GitHub
parent b98a7ff303
commit 89948b941b
15 changed files with 25 additions and 31 deletions

View File

@@ -106,7 +106,7 @@ void DumpDebugFacilityNames(std::back_insert_iterator<std::string> &output_itera
* @param level Debug category.
* @param message The message to output.
*/
void DebugPrint(const char *category, int level, const std::string &message)
void DebugPrint(const char *category, int level, std::string &&message)
{
if (strcmp(category, "desync") == 0 && level != 0) {
static auto f = FioFOpenFile("commands-out.log", "wb", AUTOSAVE_DIR);
@@ -128,7 +128,7 @@ void DebugPrint(const char *category, int level, const std::string &message)
if (_debug_remote_console.load()) {
/* Only add to the queue when there is at least one consumer of the data. */
std::lock_guard<std::mutex> lock(_debug_remote_console_mutex);
_debug_remote_console_queue.push_back({ category, message });
_debug_remote_console_queue.emplace_back(category, std::move(message));
}
}
}