mirror of
https://github.com/nlohmann/json.git
synced 2026-10-05 06:00:29 +00:00
Fix CI: bind j_nested_const by reference in the json_pointer test
clang-tidy (ci_clang_tidy) flagged the new test with performance-unnecessary-copy-initialization: the local copy j_nested_const of j_nested is never modified. Bind it as a const reference instead; it still exercises the const overloads of at() and contains(). Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
@@ -384,7 +384,7 @@ TEST_CASE("JSON pointers")
|
|||||||
// contains() must not throw for an empty reference token if the current
|
// contains() must not throw for an empty reference token if the current
|
||||||
// value is an array (cf. #5395) -- at() still reports out_of_range.404
|
// value is an array (cf. #5395) -- at() still reports out_of_range.404
|
||||||
json j_nested = {{"a", {1, 2}}};
|
json j_nested = {{"a", {1, 2}}};
|
||||||
const json j_nested_const = j_nested;
|
const json& j_nested_const = j_nested;
|
||||||
json::json_pointer const jp("/a/");
|
json::json_pointer const jp("/a/");
|
||||||
std::string const throw_msg = "[json.exception.out_of_range.404] unresolved reference token ''";
|
std::string const throw_msg = "[json.exception.out_of_range.404] unresolved reference token ''";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user