Skip to content

Commit 9411971

Browse files
committed
Simplify ascii check
1 parent b535150 commit 9411971

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

src/cpp/encoding/Encodings.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,13 @@ namespace
7070
{
7171
bool isAsciiUtf8Buffer(const View<uint8_t>& buffer)
7272
{
73-
auto i = int64_t{ 0 };
74-
while (i < buffer.length)
73+
for (int64_t i = 0; i < buffer.length; i++)
7574
{
76-
auto p = cpp::encoding::Utf8::codepoint(buffer.slice(i));
77-
78-
if (p > 127)
75+
if (buffer[i] > 127)
7976
{
8077
return false;
8178
}
82-
83-
i += cpp::encoding::Utf8::getByteCount(p);
8479
}
85-
8680
return true;
8781
}
8882
}

0 commit comments

Comments
 (0)