Fix clang-tidy performance-inefficient-string-concatenation in unit-json_view_builder

Fixes the ci_clang_tidy failure at tests/src/unit-json_view_builder.cpp:549.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-31 16:19:56 +01:00
1 parent 6491563cbb
commit 0efa09cf49
1 file changed
+5 -1
+5 -1
View File
@@ -546,7 +546,11 @@ TEST_CASE("json_view builder: fraction digits")
const std::string number = std::string(rng() % 2 == 0 ? "-" : "") + std::to_string(rng() % 100000) + "." + fraction;
check_same(number);
check_same("[" + number + "]");
check_same("[" + number + "," + number + "]");
std::string pair = "[" + number;
pair += ",";
pair += number;
pair += "]";
check_same(pair);
check_same("{\"a\":" + number + "}");
for (const char follower : followers)
{