[ezo] Use make_unique to construct EzoCommand (#16092)

This commit is contained in:
Jonathan Swoboda
2026-04-28 16:50:15 -04:00
committed by GitHub
parent 16cf4fb5e8
commit 3d195d748c

View File

@@ -35,7 +35,7 @@ void EZOSensor::update() {
}
if (!found) {
std::unique_ptr<EzoCommand> ezo_command(new EzoCommand);
auto ezo_command = make_unique<EzoCommand>();
ezo_command->command = "R";
ezo_command->command_type = EzoCommandType::EZO_READ;
ezo_command->delay_ms = 900;
@@ -162,7 +162,7 @@ void EZOSensor::loop() {
}
void EZOSensor::add_command_(const char *command, EzoCommandType command_type, uint16_t delay_ms) {
std::unique_ptr<EzoCommand> ezo_command(new EzoCommand);
auto ezo_command = make_unique<EzoCommand>();
ezo_command->command = command;
ezo_command->command_type = command_type;
ezo_command->delay_ms = delay_ms;