Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix merge_patch shadow warning #1346

Merged
merged 2 commits into from
Nov 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7851,7 +7851,7 @@ class basic_json
Thereby, `Target` is the current object; that is, the patch is applied to
the current value.

@param[in] patch the patch to apply
@param[in] apply_patch the patch to apply

@complexity Linear in the lengths of @a patch.

Expand All @@ -7863,15 +7863,15 @@ class basic_json

@since version 3.0.0
*/
void merge_patch(const basic_json& patch)
void merge_patch(const basic_json& apply_patch)
{
if (patch.is_object())
if (apply_patch.is_object())
{
if (not is_object())
{
*this = object();
}
for (auto it = patch.begin(); it != patch.end(); ++it)
for (auto it = apply_patch.begin(); it != apply_patch.end(); ++it)
{
if (it.value().is_null())
{
Expand All @@ -7885,7 +7885,7 @@ class basic_json
}
else
{
*this = patch;
*this = apply_patch;
}
}

Expand Down
10 changes: 5 additions & 5 deletions single_include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20113,7 +20113,7 @@ class basic_json
Thereby, `Target` is the current object; that is, the patch is applied to
the current value.

@param[in] patch the patch to apply
@param[in] apply_patch the patch to apply

@complexity Linear in the lengths of @a patch.

Expand All @@ -20125,15 +20125,15 @@ class basic_json

@since version 3.0.0
*/
void merge_patch(const basic_json& patch)
void merge_patch(const basic_json& apply_patch)
{
if (patch.is_object())
if (apply_patch.is_object())
{
if (not is_object())
{
*this = object();
}
for (auto it = patch.begin(); it != patch.end(); ++it)
for (auto it = apply_patch.begin(); it != apply_patch.end(); ++it)
{
if (it.value().is_null())
{
Expand All @@ -20147,7 +20147,7 @@ class basic_json
}
else
{
*this = patch;
*this = apply_patch;
}
}

Expand Down