mirror of
https://github.com/nlohmann/json.git
synced 2026-10-06 22:47:13 +00:00
* Check for the expected separator before the lexer's token switch After a key the parser expects ':', after a value usually ','. Test for that character first instead of going through scan()'s switch, which compiles to an indirect jump. Any other character takes the old path, so tokens and error messages are unchanged. Parsing 6.3% faster with GCC 15.2 and 2.7% with Clang 22.1 (geomean of the ParseString, ParseFile and ParseIndented benchmarks). Signed-off-by: Michiel van Slobbe <michiel.van.slobbe@gmail.com> * Improvement: address PR comments Signed-off-by: Michiel van Slobbe <michiel.van.slobbe@gmail.com> * fix: address comments Signed-off-by: Michiel van Slobbe <michiel.van.slobbe@gmail.com> * Fix clang-tidy bugprone-signed-char-misuse in scan_expecting Convert the expected separator through unsigned char before storing it as char_int_type. The generated code is unchanged. Signed-off-by: Michiel van Slobbe <michiel.van.slobbe@gmail.com> * Use raw string literals in the separator comment tests Signed-off-by: Michiel van Slobbe <michiel.van.slobbe@gmail.com> --------- Signed-off-by: Michiel van Slobbe <michiel.van.slobbe@gmail.com> Co-authored-by: Michiel van Slobbe <michiel.van.slobbe@gmail.com>