mirror of
https://github.com/nlohmann/json.git
synced 2026-10-15 10:47:13 +00:00
json_pointer::flatten inserted every leaf with operator[], which searches ordered_map linearly, so flatten() was quadratic (citm_catalog.json: 265 ms vs 5 ms for json). Flattened paths are unique by construction, so ordered_map gets emplace_new_key() to append a key known to be absent; other object types still use operator[]. Parent pointers are set once at the end for JSON_DIAGNOSTICS. Signed-off-by: Niels Lohmann <mail@nlohmann.me>