Skip to content

Commit

Permalink
Simpify CharsetEncoder::isTriviallyCopyable
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-webb committed Aug 9, 2023
1 parent cfe9590 commit b8c7307
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/cpp/charsetencoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,15 +648,13 @@ void CharsetEncoder::encode(CharsetEncoderPtr& enc,

bool CharsetEncoder::isTriviallyCopyable(const LogString& src, const CharsetEncoderPtr& enc)
{
bool result = false;
bool result;
if (dynamic_cast<LocaleCharsetEncoder*>(enc.get()))
{
result = src.end() == std::find_if(src.begin(), src.end()
, [](const logchar& ch) -> bool { return 0x80 <= (unsigned int)ch; });
}
#if LOG4CXX_LOGCHAR_IS_UTF8
else
result = !!dynamic_cast<TrivialCharsetEncoder*>(enc.get());
#endif
return result;
}

0 comments on commit b8c7307

Please sign in to comment.