moves the comment to a more appropriate position, nullifies the root if referenced in erase

This commit is contained in:
Timothy Prepscius 2018-10-23 17:51:58 -04:00
parent 44166ff4d6
commit e66a3e5242

View File

@ -409,15 +409,17 @@ class json_pointer
// if we get here, it means that no exception was thrown, so therefore the value specified to
// erase exists
// if previous exists, it means that the specified json value was not a root, so, we use the previous
// object and erase from it
if (previous)
{
// if previous exists, it means that the specified json value was not a root, so, we use the previous
// object and erase from it
previous->erase(reference_tokens.back());
}
else
{
// what to do
// else it means the root was referenced, so we nullify it.
if (ptr != nullptr)
*ptr = {};
}
}