From 3ef26f10eafbd2adff8fc012a77e43070927edfe Mon Sep 17 00:00:00 2001 From: scuzqy Date: Tue, 14 Nov 2023 11:13:36 +0800 Subject: [PATCH] [easylog]if statement can be constexpr --- include/ylt/easylog.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/ylt/easylog.hpp b/include/ylt/easylog.hpp index 348e9cbed..4c0baf3cb 100644 --- a/include/ylt/easylog.hpp +++ b/include/ylt/easylog.hpp @@ -213,7 +213,7 @@ inline void add_appender(std::function fn) { easylog::record_t(std::chrono::system_clock::now(), severity, \ GET_STRING(__FILE__, __LINE__)) \ .sprintf(fmt, __VA_ARGS__); \ - if (severity == easylog::Severity::CRITICAL) { \ + if constexpr (severity == easylog::Severity::CRITICAL) { \ easylog::flush(); \ std::exit(EXIT_FAILURE); \ } \