Skip to content

Commit

Permalink
remove unnecessary branch
Browse files Browse the repository at this point in the history
  • Loading branch information
odygrd committed Aug 27, 2024
1 parent bdb0aa2 commit b6d13e3
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions include/quill/core/Codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,8 @@ struct Codec
size_t const len = arg.length();
std::memcpy(buffer, &len, sizeof(len));
buffer += sizeof(len);

if (QUILL_LIKELY(len != 0))
{
// copy the string, no need to zero terminate it as we got the length
std::memcpy(buffer, arg.data(), len);
buffer += len;
}
std::memcpy(buffer, arg.data(), len);
buffer += len;
}
else
{
Expand Down

0 comments on commit b6d13e3

Please sign in to comment.