mirror of https://github.com/AxioDL/metaforce.git
Console: Use std::move within vreport()
Avoids redundant copies when emplacing into the log container.
This commit is contained in:
parent
c8eab43489
commit
358acfe944
|
@ -177,8 +177,9 @@ bool Console::commandExists(std::string_view cmd) const {
|
|||
void Console::vreport(Level level, fmt::string_view fmt, fmt::format_args args) {
|
||||
std::string tmp = fmt::vformat(fmt, args);
|
||||
std::vector<std::string> lines = athena::utility::split(tmp, '\n');
|
||||
for (const std::string& line : lines)
|
||||
m_log.emplace_back(line, level);
|
||||
for (std::string& line : lines) {
|
||||
m_log.emplace_back(std::move(line), level);
|
||||
}
|
||||
fmt::print(fmt("{}\n"), tmp);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue