mirror of
https://github.com/nlohmann/json.git
synced 2026-11-02 10:55:35 +00:00
Fix clang-tidy errors in json_view tests on develop (#5989)
readability-math-missing-parentheses in unit-json_view_builder.cpp (#5974) and performance-inefficient-string-concatenation in unit-json_view_positions.cpp. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
1 parent
ddc34f546a
commit
67b103e506
2 files changed
+3
-2
No files matched your search
@@ -692,7 +692,7 @@ TEST_CASE("json_view builder: fraction digits")
|
||||
check_same(number);
|
||||
check_same("[" + number + "]");
|
||||
std::string pair;
|
||||
pair.reserve(number.size() * 2 + 3);
|
||||
pair.reserve((number.size() * 2) + 3);
|
||||
pair += '[';
|
||||
pair += number;
|
||||
pair += ',';
|
||||
|
||||
@@ -521,7 +521,8 @@ TEST_CASE("json_view exceptions name the path and the bytes of the value")
|
||||
std::string text = "7";
|
||||
for (int level = 0; level < 40; ++level)
|
||||
{
|
||||
text = R"([[1, [2]], )" + text + R"(, {"k": [3, {"l": [4]}]}, [5, [6, [7]]]])";
|
||||
text.insert(0, R"([[1, [2]], )");
|
||||
text += R"(, {"k": [3, {"l": [4]}]}, [5, [6, [7]]]])";
|
||||
}
|
||||
CAPTURE(text)
|
||||
const json j = json::parse(text);
|
||||
|
||||
Reference in new issue
Block a user