mirror of
https://github.com/esphome/esphome.git
synced 2026-06-01 01:19:45 +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) {
|
: success_(success), error_message_(error_message) {
|
||||||
if (data == nullptr || data_len == 0)
|
if (data == nullptr || data_len == 0)
|
||||||
return;
|
return;
|
||||||
this->json_document_ = json::parse_json(data, data_len);
|
JsonDocument tmp = json::parse_json(data, data_len);
|
||||||
|
swap(this->json_document_, tmp);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user