Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Dec 26, 2023
1 parent 97c2d59 commit c157955
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions include/json5.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -738,13 +738,11 @@ inline typename parser5<StringT>::u8char parser5<StringT>::peek(const StringIter
uint8_t head = *begin;
uint64_t ch = head;
size_t len = 1;
auto sep = begin + len - 1;
while (begin != end && sep != end && (head & 0b11000000) > 0b10000000) {
while ((head & 0b11000000) > 0b10000000) {
head <<= 1;
++len;
ch <<= 8;
ch += (uint8_t)(*sep);
sep = begin + len - 1;
ch += (uint8_t)(*(begin + len - 1));
}
if (plen) {
*plen = len;
Expand Down

0 comments on commit c157955

Please sign in to comment.