mirror of
https://github.com/nlohmann/json.git
synced 2026-10-15 10:47:13 +00:00
set_parent() re-parented the whole container for ordered_json on every call (push_back, emplace_back, at(), operator[] on existing keys), making array building quadratic. at() and array append now set only the one child's parent; object insertion re-parents only if the vector capacity changed. Also drop the redundant set_parents() in the copy constructor. Adds a parent-pointer invariant test. Signed-off-by: Niels Lohmann <mail@nlohmann.me>