From 8166b18fc6de492029767a8b58278935626941a8 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Fri, 28 Aug 2026 14:50:29 +0000 Subject: [PATCH] Address review comments on the simdutf backend string_bulk_run() had the same `return scalar_string_bulk_run(...)` in both arms of the `#if`. The simdutf arm already falls through when validation fails, so a single return after the `#endif` says the same thing. The JSON_USE_SIMDUTF example showed `#include `, which string_scan.hpp already does under the same guard; users only have to put the header on the include path and link the library, not include it themselves. Set the version history entry to 3.13.0, matching the other macro pages documenting unreleased features. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01MXDi7NTMKAmoArUZSKMc4T Signed-off-by: Niels Lohmann --- docs/mkdocs/docs/api/macros/json_use_simdutf.md | 3 +-- include/nlohmann/detail/input/string_scan.hpp | 4 +--- single_include/nlohmann/json.hpp | 4 +--- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/docs/mkdocs/docs/api/macros/json_use_simdutf.md b/docs/mkdocs/docs/api/macros/json_use_simdutf.md index c1bb4da12..507a1009b 100644 --- a/docs/mkdocs/docs/api/macros/json_use_simdutf.md +++ b/docs/mkdocs/docs/api/macros/json_use_simdutf.md @@ -41,7 +41,6 @@ By default, `#!cpp JSON_USE_SIMDUTF` is not defined and the portable C++11 scala ```cpp #define JSON_USE_SIMDUTF 1 - #include #include ... @@ -56,4 +55,4 @@ By default, `#!cpp JSON_USE_SIMDUTF` is not defined and the portable C++11 scala ## Version history -- Added in version 3.12.1. +- Added in version 3.13.0. diff --git a/include/nlohmann/detail/input/string_scan.hpp b/include/nlohmann/detail/input/string_scan.hpp index 798bcc598..63c74db85 100644 --- a/include/nlohmann/detail/input/string_scan.hpp +++ b/include/nlohmann/detail/input/string_scan.hpp @@ -227,10 +227,8 @@ inline std::size_t string_bulk_run(const unsigned char* data, std::size_t n) noe { return run; } - return scalar_string_bulk_run(data, n); -#else - return scalar_string_bulk_run(data, n); #endif + return scalar_string_bulk_run(data, n); } } // namespace detail diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index ae073e4ba..9ba0445a3 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -8360,10 +8360,8 @@ inline std::size_t string_bulk_run(const unsigned char* data, std::size_t n) noe { return run; } - return scalar_string_bulk_run(data, n); -#else - return scalar_string_bulk_run(data, n); #endif + return scalar_string_bulk_run(data, n); } } // namespace detail