| 36 | // --------------------------------------------------------------------------- |
| 37 | |
| 38 | static 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 |
no test coverage detected