Drop the position updates in the bulk \u path, which #5809 made unused

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-13 17:27:03 +02:00
1 parent 7074088d4f
commit 711093e7af
2 files changed
+6 -12

No files matched your search

+3 -6
View File
@@ -235,9 +235,9 @@ class lexer : public lexer_base<BasicJsonType>
/// contiguous input: try to decode the 4 hex digits following `\\u` /// contiguous input: try to decode the 4 hex digits following `\\u`
/// directly from the input buffer via hex_codepoint(), instead of 4 calls /// directly from the input buffer via hex_codepoint(), instead of 4 calls
/// to get(). On success, advances the adapter and the position counters /// to get(). On success, advances the adapter exactly as those 4 get()
/// exactly as those 4 get() calls would (a hex digit is never '\n', so /// calls would (bulk_scan implies lazy_position, so there are no position
/// only the flat counters move) and leaves @a current holding the last of /// counters to advance) and leaves @a current holding the last of
/// the 4 digits, just as the last such get() would; the codepoint is /// the 4 digits, just as the last such get() would; the codepoint is
/// written to @a out. Makes no state change and returns false - for a /// written to @a out. Makes no state change and returns false - for a
/// pending unget, fewer than 4 remaining bytes, or any of the 4 bytes not /// pending unget, fewer than 4 remaining bytes, or any of the 4 bytes not
@@ -257,9 +257,6 @@ class lexer : public lexer_base<BasicJsonType>
return false; return false;
} }
ia.bulk_skip(4); ia.bulk_skip(4);
// a hex digit is never a newline, so only the flat counters advance
position.chars_read_total += 4;
position.chars_read_current_line += 4;
current = char_traits<char_type>::to_int_type(raw[3]); current = char_traits<char_type>::to_int_type(raw[3]);
out = codepoint; out = codepoint;
return true; return true;
+3 -6
View File
@@ -11072,9 +11072,9 @@ class lexer : public lexer_base<BasicJsonType>
/// contiguous input: try to decode the 4 hex digits following `\\u` /// contiguous input: try to decode the 4 hex digits following `\\u`
/// directly from the input buffer via hex_codepoint(), instead of 4 calls /// directly from the input buffer via hex_codepoint(), instead of 4 calls
/// to get(). On success, advances the adapter and the position counters /// to get(). On success, advances the adapter exactly as those 4 get()
/// exactly as those 4 get() calls would (a hex digit is never '\n', so /// calls would (bulk_scan implies lazy_position, so there are no position
/// only the flat counters move) and leaves @a current holding the last of /// counters to advance) and leaves @a current holding the last of
/// the 4 digits, just as the last such get() would; the codepoint is /// the 4 digits, just as the last such get() would; the codepoint is
/// written to @a out. Makes no state change and returns false - for a /// written to @a out. Makes no state change and returns false - for a
/// pending unget, fewer than 4 remaining bytes, or any of the 4 bytes not /// pending unget, fewer than 4 remaining bytes, or any of the 4 bytes not
@@ -11094,9 +11094,6 @@ class lexer : public lexer_base<BasicJsonType>
return false; return false;
} }
ia.bulk_skip(4); ia.bulk_skip(4);
// a hex digit is never a newline, so only the flat counters advance
position.chars_read_total += 4;
position.chars_read_current_line += 4;
current = char_traits<char_type>::to_int_type(raw[3]); current = char_traits<char_type>::to_int_type(raw[3]);
out = codepoint; out = codepoint;
return true; return true;