MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / computeDiff

Function computeDiff

pj_dialog_host/src/dialog_engine.cpp:38–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36// ---------------------------------------------------------------------------
37
38static nlohmann::json computeDiff(const nlohmann::json& old_data, const nlohmann::json& new_data) {
39 nlohmann::json diff = nlohmann::json::object();
40 for (const auto& [key, val] : new_data.items()) {
41 if (!old_data.contains(key) || old_data[key] != val) {
42 diff[key] = val;
43 }
44 }
45 return diff;
46}
47
48// ---------------------------------------------------------------------------
49// apply_and_diff: re-read widget data, apply (diffed or full), update prev

Callers 2

applyAndDiffFunction · 0.85
showDialogMethod · 0.85

Calls 2

itemsMethod · 0.80
containsMethod · 0.45

Tested by

no test coverage detected