mirror of
https://github.com/nlohmann/json.git
synced 2026-11-01 02:15:42 +00:00
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:
1 file changed
+5
-1
@@ -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;
|
const std::string number = std::string(rng() % 2 == 0 ? "-" : "") + std::to_string(rng() % 100000) + "." + fraction;
|
||||||
check_same(number);
|
check_same(number);
|
||||||
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 + "}");
|
check_same("{\"a\":" + number + "}");
|
||||||
for (const char follower : followers)
|
for (const char follower : followers)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user