Skip to content

Commit

Permalink
use if constexpr for always constant test known at compilation time
Browse files Browse the repository at this point in the history
  • Loading branch information
robUx4 committed Feb 18, 2024
1 parent 3a015a4 commit 828c7f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/EbmlUnicodeString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 828c7f1

Please sign in to comment.