Skip to content

Commit

Permalink
Merge pull request #444 from MonkeybreadSoftware/patch-2
Browse files Browse the repository at this point in the history
Fix for shadowed path variable for JSON Query
  • Loading branch information
danielaparker authored Sep 22, 2023
2 parents 695775c + 78fa9b4 commit 1d9f23a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/jsoncons_ext/jsonpath/json_query.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ namespace jsonpath {

jsoncons::jsonpath::detail::dynamic_resources<Json,reference> resources;

auto f = [&callback](const json_location_type& path, reference val)
auto f = [&callback](const json_location_type& pathp, reference val)
{
callback(path.to_string(), val);
callback(pathp.to_string(), val);
};
expr.evaluate_with_replacement(resources, instance, resources.root_path_node(), instance, f);
}
Expand All @@ -154,9 +154,9 @@ namespace jsonpath {

jsoncons::jsonpath::detail::dynamic_resources<Json,reference> resources{alloc_set.get_allocator()};

auto f = [&callback](const json_location_type& path, reference val)
auto f = [&callback](const json_location_type& pathp, reference val)
{
callback(path.to_string(), val);
callback(pathp.to_string(), val);
};
expr.evaluate_with_replacement(resources, instance, resources.root_path_node(), instance, f);
}
Expand Down

0 comments on commit 1d9f23a

Please sign in to comment.