mirror of
https://github.com/nlohmann/json.git
synced 2026-10-22 22:08:55 +00:00
diff_operation() created each operation through three operator[] calls and assignments. The keys "op", "path" and "value" are distinct and already in the order of std::map, so they are added with the positional insert that flatten() uses, constructing the values in place. diff() (instructions on macOS, Linux Ir GCC 13 / Clang 18): canada 85.3M -> 82.0M, 51.1M -> 50.7M / 55.3M -> 50.2M; citm_catalog 22.0M -> 21.5M, 14.3M -> 14.2M / 14.9M -> 14.2M; twitter 12.4M -> 12.0M, 7.5M unchanged / 8.0M -> 7.5M. Output is identical. Signed-off-by: Niels Lohmann <mail@nlohmann.me>