mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 02:37:36 +02:00
Suppress MSVC warnings "C4127: conditional expression is constant" by used const_check (#4233)
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
This commit is contained in:
committed by
GitHub
parent
720da57bab
commit
542600013f
@ -1695,7 +1695,7 @@ FMT_API auto is_printable(uint32_t cp) -> bool;
|
||||
|
||||
inline auto needs_escape(uint32_t cp) -> bool {
|
||||
if (cp < 0x20 || cp == 0x7f || cp == '"' || cp == '\\') return true;
|
||||
if (FMT_OPTIMIZE_SIZE > 1) return false;
|
||||
if (const_check(FMT_OPTIMIZE_SIZE > 1)) return false;
|
||||
return !is_printable(cp);
|
||||
}
|
||||
|
||||
@ -1718,7 +1718,7 @@ auto find_escape(const Char* begin, const Char* end)
|
||||
|
||||
inline auto find_escape(const char* begin, const char* end)
|
||||
-> find_escape_result<char> {
|
||||
if (!use_utf8) return find_escape<char>(begin, end);
|
||||
if (const_check(!use_utf8)) return find_escape<char>(begin, end);
|
||||
auto result = find_escape_result<char>{end, nullptr, 0};
|
||||
for_each_codepoint(string_view(begin, to_unsigned(end - begin)),
|
||||
[&](uint32_t cp, string_view sv) {
|
||||
|
Reference in New Issue
Block a user