Skip to content

Commit

Permalink
🚨 fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
nlohmann committed Nov 9, 2024
1 parent e9ced38 commit b3dba9f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4733,7 +4733,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
};

// wrapper for "add" operation; add value at ptr
const auto operation_add = [&result](json_pointer & ptr, basic_json val)
const auto operation_add = [&result](json_pointer & ptr, const basic_json & val)
{
// adding to the root of the target document means replacing it
if (ptr.empty())
Expand Down
2 changes: 1 addition & 1 deletion single_include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24062,7 +24062,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
};

// wrapper for "add" operation; add value at ptr
const auto operation_add = [&result](json_pointer & ptr, basic_json val)
const auto operation_add = [&result](json_pointer & ptr, const basic_json & val)
{
// adding to the root of the target document means replacing it
if (ptr.empty())
Expand Down
2 changes: 1 addition & 1 deletion tests/src/unit-json_patch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,7 @@ TEST_CASE("JSON patch")
const auto& doc = test["doc"];
const auto& patch = test["patch"];

if (test.count("error") == 0)
if (test.count("error") == 0) // NOLINT(readability-container-contains)
{
// if an expected value is given, use it; use doc otherwise
const auto& expected = test.value("expected", doc);
Expand Down

0 comments on commit b3dba9f

Please sign in to comment.