mirror of
https://github.com/esphome/esphome.git
synced 2026-05-20 17:52:00 +08:00
[api] Avoid JsonDocument copy-and-swap operator= in ActionResponse ctor (#16106)
This commit is contained in:
@@ -78,7 +78,8 @@ class ActionResponse {
|
||||
: success_(success), error_message_(error_message) {
|
||||
if (data == nullptr || data_len == 0)
|
||||
return;
|
||||
this->json_document_ = json::parse_json(data, data_len);
|
||||
JsonDocument tmp = json::parse_json(data, data_len);
|
||||
swap(this->json_document_, tmp);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user