refactor(Core/Misc): Use emplace_back instead of push_back to avoid extra copy/m… (#20114)

refactor: Use emplace_back instead of push_back to avoid extra copy/move operations
This commit is contained in:
Angelo Venturini
2024-10-10 16:55:58 -03:00
committed by GitHub
parent cfb3229bf1
commit 9487b30ad7
10 changed files with 32 additions and 35 deletions

View File

@@ -74,7 +74,7 @@ void ChannelMgr::LoadChannels()
if (!Utf8toWStr(channelName, channelWName))
{
LOG_ERROR("server.loading", "Failed to load channel '{}' from database - invalid utf8 sequence? Deleted.", channelName);
toDelete.push_back({ channelName, team });
toDelete.emplace_back(channelName, team);
continue;
}
@@ -82,7 +82,7 @@ void ChannelMgr::LoadChannels()
if (!mgr)
{
LOG_ERROR("server.loading", "Failed to load custom chat channel '{}' from database - invalid team {}. Deleted.", channelName, team);
toDelete.push_back({ channelName, team });
toDelete.emplace_back(channelName, team);
continue;
}