mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-20 05:05:38 +00:00
Fix style issue
This commit is contained in:
parent
704ec8dea6
commit
2a1ee419b4
@ -150,20 +150,27 @@ void WriteBufferValidUTF8::finalizeImpl()
|
|||||||
nextImpl();
|
nextImpl();
|
||||||
|
|
||||||
/// Handle remaining bytes if we have an incomplete sequence
|
/// Handle remaining bytes if we have an incomplete sequence
|
||||||
if (working_buffer.begin() != memory.data()) {
|
if (working_buffer.begin() != memory.data())
|
||||||
|
{
|
||||||
char * p = memory.data();
|
char * p = memory.data();
|
||||||
|
|
||||||
while (p < pos) {
|
while (p < pos)
|
||||||
|
{
|
||||||
UInt8 len = length_of_utf8_sequence[static_cast<unsigned char>(*p)];
|
UInt8 len = length_of_utf8_sequence[static_cast<unsigned char>(*p)];
|
||||||
if (p + len > pos) {
|
if (p + len > pos)
|
||||||
|
{
|
||||||
// Incomplete sequence. Skip one byte.
|
// Incomplete sequence. Skip one byte.
|
||||||
putReplacement();
|
putReplacement();
|
||||||
++p;
|
++p;
|
||||||
} else if (Poco::UTF8Encoding::isLegal(reinterpret_cast<unsigned char *>(p), len)) {
|
}
|
||||||
|
else if (Poco::UTF8Encoding::isLegal(reinterpret_cast<unsigned char *>(p), len))
|
||||||
|
{
|
||||||
// Valid sequence
|
// Valid sequence
|
||||||
putValid(p, len);
|
putValid(p, len);
|
||||||
p += len;
|
p += len;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// Invalid sequence, skip first byte.
|
// Invalid sequence, skip first byte.
|
||||||
putReplacement();
|
putReplacement();
|
||||||
++p;
|
++p;
|
||||||
|
Loading…
Reference in New Issue
Block a user