From 607779cccfcc52ca10145f0b2d7f7e2d0bf16001 Mon Sep 17 00:00:00 2001 From: gabime Date: Mon, 13 Aug 2018 12:27:11 +0300 Subject: [PATCH] micro optimization in log_msg constructor --- include/spdlog/details/log_msg.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/spdlog/details/log_msg.h b/include/spdlog/details/log_msg.h index ce988e4f..3272dd5d 100644 --- a/include/spdlog/details/log_msg.h +++ b/include/spdlog/details/log_msg.h @@ -16,17 +16,18 @@ namespace details { struct log_msg { log_msg() = default; + log_msg(const std::string *loggers_name, level::level_enum lvl) : logger_name(loggers_name) , level(lvl) - { #ifndef SPDLOG_NO_DATETIME - time = os::now(); + , time(os::now()) #endif #ifndef SPDLOG_NO_THREAD_ID - thread_id = os::thread_id(); + , thread_id(os::thread_id()) #endif + { } log_msg(const log_msg &other) = delete;