Skip to content

Commit b87f98b

Browse files
committed
fast check for ascii
1 parent 16a8251 commit b87f98b

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

include/jsoncons/utility/unicode_traits.hpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,12 +1154,7 @@ namespace unicode_traits {
11541154
{
11551155
if ((end - it) >= 8)
11561156
{
1157-
uint64_t chunk;
1158-
std::memcpy(&chunk, it, 8);
1159-
if ((chunk & mask) == 0) {
1160-
it += 8;
1161-
continue;
1162-
}
1157+
while (true) JSONCONS_REPEAT8({if (JSONCONS_LIKELY((trailing_bytes_for_utf8[*it] == 0) && (*it >= 0x80 && *it < 0xC2))) ++it; else break;})
11631158
}
11641159
const std::size_t len = static_cast<std::size_t>(trailing_bytes_for_utf8[*it]) + 1;
11651160
if (len > (std::size_t)(end - it))

0 commit comments

Comments
 (0)