Skip to content

Commit 4d5da04

Browse files
authored
[easylog]if statement can be constexpr (#494)
1 parent 51505c4 commit 4d5da04

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/ylt/easylog.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ inline void add_appender(std::function<void(std::string_view)> fn) {
213213
easylog::record_t(std::chrono::system_clock::now(), severity, \
214214
GET_STRING(__FILE__, __LINE__)) \
215215
.sprintf(fmt, __VA_ARGS__); \
216-
if (severity == easylog::Severity::CRITICAL) { \
216+
if constexpr (severity == easylog::Severity::CRITICAL) { \
217217
easylog::flush<Id>(); \
218218
std::exit(EXIT_FAILURE); \
219219
} \
@@ -240,7 +240,7 @@ inline void add_appender(std::function<void(std::string_view)> fn) {
240240
easylog::record_t(std::chrono::system_clock::now(), severity, \
241241
GET_STRING(__FILE__, __LINE__)) \
242242
.format(prefix::format(format_str, __VA_ARGS__)); \
243-
if (severity == easylog::Severity::CRITICAL) { \
243+
if constexpr (severity == easylog::Severity::CRITICAL) { \
244244
easylog::flush<Id>(); \
245245
std::exit(EXIT_FAILURE); \
246246
} \

0 commit comments

Comments
 (0)