mirror of
https://github.com/nlohmann/json.git
synced 2026-08-22 09:03:18 +00:00
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:
@@ -540,7 +540,7 @@ TEST_CASE("serialization of deeply nested values")
|
|||||||
CHECK(json::parse(array_text).dump() == array_text);
|
CHECK(json::parse(array_text).dump() == array_text);
|
||||||
|
|
||||||
std::string object_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)
|
for (std::size_t i = 0; i < depth; ++i)
|
||||||
{
|
{
|
||||||
object_text += "{\"a\":";
|
object_text += "{\"a\":";
|
||||||
|
|||||||
Reference in New Issue
Block a user