[web_server] Avoid temporary std::string allocations in request parameter parsing (#14366)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
00242443e1
commit
54f410901f
11 files changed
+82
-32
No files matched your search
@@ -889,7 +889,7 @@ uint16_t APIConnection::try_send_text_info(EntityBase *entity, APIConnection *co
|
||||
}
|
||||
void APIConnection::on_text_command_request(const TextCommandRequest &msg) {
|
||||
ENTITY_COMMAND_MAKE_CALL(text::Text, text, text)
|
||||
call.set_value(msg.state);
|
||||
call.set_value(msg.state.c_str(), msg.state.size());
|
||||
call.perform();
|
||||
}
|
||||
#endif
|
||||
@@ -1360,7 +1360,7 @@ void APIConnection::on_alarm_control_panel_command_request(const AlarmControlPan
|
||||
call.pending();
|
||||
break;
|
||||
}
|
||||
call.set_code(msg.code);
|
||||
call.set_code(msg.code.c_str(), msg.code.size());
|
||||
call.perform();
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user