From 828c7f1bc2b67d7c0c212a72200d3732f7a40561 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Sun, 18 Feb 2024 16:57:31 +0100 Subject: [PATCH] use if constexpr for always constant test known at compilation time --- src/EbmlUnicodeString.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EbmlUnicodeString.cpp b/src/EbmlUnicodeString.cpp index 9ad1e6e3..124fe356 100644 --- a/src/EbmlUnicodeString.cpp +++ b/src/EbmlUnicodeString.cpp @@ -86,7 +86,7 @@ void UTFstring::UpdateFromUCS2(std::wstring_view WString) // representation must actually be compatible with the C++ // library's implementation. Implementations with sizeof(wchar_t) // == 4 are using UCS4. - if (sizeof(wchar_t) == 2) + if constexpr (sizeof(wchar_t) == 2) ::utf8::utf16to8(WString.begin(), Current, std::back_inserter(UTF8string)); else ::utf8::utf32to8(WString.begin(), Current, std::back_inserter(UTF8string));