1
0
mirror of https://github.com/nlohmann/json synced 2024-11-29 15:11:04 +00:00

a conceptual quick fix for #269

This commit is contained in:
Niels 2016-06-22 20:05:44 +02:00
parent 15a314abea
commit 3f97a5d5ad
2 changed files with 10 additions and 4 deletions

View File

@ -10002,13 +10002,16 @@ basic_json_parser_63:
// in a second pass, traverse the remaining elements
// remove my remaining elements
const auto end_index = static_cast<difference_type>(result.size());
while (i < source.size())
{
result.push_back(object(
// add operations in reverse order to avoid invalid
// indices
result.insert(result.begin() + end_index,
{
{"op", "remove"},
{"path", path + "/" + std::to_string(i)}
}));
});
++i;
}

View File

@ -9312,13 +9312,16 @@ class basic_json
// in a second pass, traverse the remaining elements
// remove my remaining elements
const auto end_index = static_cast<difference_type>(result.size());
while (i < source.size())
{
result.push_back(object(
// add operations in reverse order to avoid invalid
// indices
result.insert(result.begin() + end_index,
{
{"op", "remove"},
{"path", path + "/" + std::to_string(i)}
}));
});
++i;
}