diff --git a/include/spdlog/details/async_log_helper.h b/include/spdlog/details/async_log_helper.h index 82282db9..179a3db6 100644 --- a/include/spdlog/details/async_log_helper.h +++ b/include/spdlog/details/async_log_helper.h @@ -328,13 +328,10 @@ inline bool spdlog::details::async_log_helper::process_next_msg(log_clock::time_ // Handle empty queue.. // This is the only place where the queue can terminate or flush to avoid losing messages already in the queue - else - { - auto now = details::os::now(); - handle_flush_interval(now, last_flush); - sleep_or_yield(now, last_pop); - return !_terminate_requested; - } + auto now = details::os::now(); + handle_flush_interval(now, last_flush); + sleep_or_yield(now, last_pop); + return !_terminate_requested; } // flush all sinks if _flush_interval_ms has expired diff --git a/include/spdlog/details/os.h b/include/spdlog/details/os.h index 1f44e680..a3597ca6 100644 --- a/include/spdlog/details/os.h +++ b/include/spdlog/details/os.h @@ -403,10 +403,7 @@ inline std::string errno_to_string(char buf[256], int res) { return std::string(buf); } - else - { - return "Unknown error"; - } + return "Unknown error"; } // Return errno string (thread safe) diff --git a/include/spdlog/details/pattern_formatter_impl.h b/include/spdlog/details/pattern_formatter_impl.h index 72f29270..86c89370 100644 --- a/include/spdlog/details/pattern_formatter_impl.h +++ b/include/spdlog/details/pattern_formatter_impl.h @@ -662,10 +662,10 @@ inline void spdlog::pattern_formatter::handle_flag(char flag) inline std::tm spdlog::pattern_formatter::get_time(details::log_msg& msg) { - if (_pattern_time == pattern_time_type::local) + if (_pattern_time == pattern_time_type::local) { return details::os::localtime(log_clock::to_time_t(msg.time)); - else - return details::os::gmtime(log_clock::to_time_t(msg.time)); + } + return details::os::gmtime(log_clock::to_time_t(msg.time)); } inline void spdlog::pattern_formatter::format(details::log_msg& msg) diff --git a/include/spdlog/sinks/file_sinks.h b/include/spdlog/sinks/file_sinks.h index 0266f9ae..929ec30d 100644 --- a/include/spdlog/sinks/file_sinks.h +++ b/include/spdlog/sinks/file_sinks.h @@ -236,10 +236,10 @@ private: date.tm_min = _rotation_m; date.tm_sec = 0; auto rotation_time = std::chrono::system_clock::from_time_t(std::mktime(&date)); - if (rotation_time > now) + if (rotation_time > now) { return rotation_time; - else - return std::chrono::system_clock::time_point(rotation_time + std::chrono::hours(24)); + } + return std::chrono::system_clock::time_point(rotation_time + std::chrono::hours(24)); } filename_t _base_filename;