diff --git a/src/fallback/dom_parser_implementation.cpp b/src/fallback/dom_parser_implementation.cpp index df9ab584..b2eb9a88 100644 --- a/src/fallback/dom_parser_implementation.cpp +++ b/src/fallback/dom_parser_implementation.cpp @@ -247,11 +247,10 @@ simdjson_warn_unused error_code implementation::minify(const uint8_t *buf, size_ simdjson_warn_unused bool implementation::validate_utf8(const char *buf, size_t len) const noexcept { const uint8_t *data = (const uint8_t *)buf; uint64_t pos = 0; - uint64_t next_pos = 0; uint32_t code_point = 0; while (pos < len) { // check of the next 8 bytes are ascii. - next_pos = pos + 16; + uint64_t next_pos = pos + 16; if (next_pos <= len) { // if it is safe to read 8 more bytes, check that they are ascii uint64_t v1; memcpy(&v1, data + pos, sizeof(uint64_t)); diff --git a/src/from_chars.cpp b/src/from_chars.cpp index 7250c471..397e58e0 100644 --- a/src/from_chars.cpp +++ b/src/from_chars.cpp @@ -64,7 +64,6 @@ decimal parse_decimal(const char *&p) noexcept { decimal answer; answer.num_digits = 0; answer.decimal_point = 0; - answer.negative = false; answer.truncated = false; answer.negative = (*p == '-'); if ((*p == '-') || (*p == '+')) { @@ -81,10 +80,9 @@ decimal parse_decimal(const char *&p) noexcept { answer.num_digits++; ++p; } - const char *first_after_period{}; if (*p == '.') { ++p; - first_after_period = p; + const char *first_after_period = p; // if we have not yet encountered a zero, we have to skip it as well if (answer.num_digits == 0) { // skip zeros