Skip to content

Commit

Permalink
Optimize FChar operations and processing
Browse files Browse the repository at this point in the history
  • Loading branch information
gansm committed Feb 14, 2024
1 parent 2a52181 commit 3463b53
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions final/ftypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ constexpr auto is7bit (CharT ch) noexcept -> bool
}

// Printable character verification
constexpr auto isPrintable (char ch) noexcept -> bool
inline auto isPrintable (char ch) noexcept -> bool
{
return std::isprint(int(ch));
return std::isprint(static_cast<unsigned char>(ch));
}

constexpr auto isPrintable (wchar_t ch) noexcept -> bool
inline auto isPrintable (wchar_t ch) noexcept -> bool
{
return std::iswprint(std::wint_t(ch));
}
Expand Down Expand Up @@ -404,7 +404,7 @@ constexpr auto isFUnicodeEqual (const FUnicode& lhs, const FUnicode& rhs) noexce
#else
inline auto isFUnicodeEqual (const FUnicode& lhs, const FUnicode& rhs) noexcept -> bool
{
static_assert ( lhs.size() == rhs.size() , "Both sides are different sizes.");
static_assert ( sizeof(lhs) == sizeof(rhs) , "Both sides are different sizes.");
// Perform a byte-wise comparison
return std::memcmp(lhs.data(), rhs.data(), lhs.size() * sizeof(wchar_t)) == 0;
}
Expand Down

0 comments on commit 3463b53

Please sign in to comment.