[Controller Queue] Reduce bin size by using inheritance

This commit is contained in:
TD-er
2022-12-31 01:15:47 +01:00
parent 9a3773ad60
commit 8fe63e47fd
38 changed files with 363 additions and 228 deletions
+3 -3
View File
@@ -180,14 +180,14 @@ bool CPlugin_015(CPlugin::Function function, struct EventStruct *event, String&
// Collect the values at the same run, to make sure all are from the same sample
uint8_t valueCount = getValueCountForTask(event->TaskIndex);
success = C015_DelayHandler->addToQueue(C015_queue_element(event, valueCount));
std::unique_ptr<C015_queue_element> element(new C015_queue_element(event, valueCount));
success = C015_DelayHandler->addToQueue(std::move(element));
if (success) {
// Element was added.
// Now we try to append to the existing element
// and thus preventing the need to create a long string only to copy it to a queue element.
C015_queue_element& element = C015_DelayHandler->sendQueue.back();
C015_queue_element& element = static_cast<C015_queue_element&>(*(C015_DelayHandler->sendQueue.back()));
for (uint8_t x = 0; x < valueCount; x++)
{