mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 10:01:33 +08:00
readability-else-after-return
This commit is contained in:
parent
9ebb9ff318
commit
d5a3bb5234
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user