Skip to content

Commit de614f9

Browse files
committed
logger: make logger a bit faster
Eliminate copying from std::stringstream if complied with C++20 or higher
1 parent 8e009e8 commit de614f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Utils/Logger.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class Logger {
9090
std::stringstream strm;
9191
strm << log_lvl << ": ";
9292
(strm << ... << std::forward<ARGS>(args)) << '\n';
93-
std::string str = strm.str();
93+
std::string str = std::move(strm).str();
9494
ssize_t rc = write(fd, std::data(str), std::size(str));
9595
(void)rc;
9696
}

0 commit comments

Comments
 (0)