Parenthesize the reserve arithmetic in the deep-nesting test

clang-tidy's readability-math-missing-parentheses wants the multiplication
spelled out in reserve(6 * depth + 1), and CI treats its warnings as errors.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann
2026-08-21 04:52:28 +02:00
parent e32337d5a8
commit a2e985554d
+1 -1
View File
@@ -540,7 +540,7 @@ TEST_CASE("serialization of deeply nested values")
CHECK(json::parse(array_text).dump() == array_text);
std::string object_text;
object_text.reserve(6 * depth + 1);
object_text.reserve((6 * depth) + 1);
for (std::size_t i = 0; i < depth; ++i)
{
object_text += "{\"a\":";