Prevent allocations caused by Logger::log_trace

C++ would always construct an `std::string` from the string constant
every iteration. Since this also happened when `YABRIDGE_DEBUG_LEVEL` is
not set to 2, this ended up causing unnecessary allocations.
This commit is contained in:
Robbert van der Helm
2021-05-23 00:21:21 +02:00
parent cf2fbf602c
commit df93944f3b
6 changed files with 40 additions and 36 deletions
-6
View File
@@ -125,9 +125,3 @@ void Logger::log(const std::string& message) {
*stream << formatted_message.str() << std::flush;
}
void Logger::log_trace(const std::string& message) {
if (verbosity >= Verbosity::all_events) {
log(message);
}
}