This commit is contained in:
J. Nick Koston
2025-06-06 12:44:02 +01:00
parent 858ea16f91
commit add7593b4a
2 changed files with 3 additions and 7 deletions

View File

@@ -1838,10 +1838,9 @@ void APIConnection::process_batch_() {
// Handle remaining items more efficiently
if (items_processed < this->deferred_batch_.items.size()) {
// Move unprocessed items to the beginning using std::move
std::move(this->deferred_batch_.items.begin() + items_processed, this->deferred_batch_.items.end(),
this->deferred_batch_.items.begin());
this->deferred_batch_.items.resize(this->deferred_batch_.items.size() - items_processed);
// Remove processed items from the beginning
this->deferred_batch_.items.erase(this->deferred_batch_.items.begin(),
this->deferred_batch_.items.begin() + items_processed);
// Reschedule for remaining items
this->schedule_batch_();

View File

@@ -487,9 +487,6 @@ class APIConnection : public APIServerConnection {
uint32_t timestamp; // When this update was queued
uint16_t message_type; // Message type for overhead calculation
// Default constructor
BatchItem() : entity(nullptr), timestamp(0), message_type(0) {}
// Constructor for creating BatchItem
BatchItem(EntityBase *entity,
std::function<EncodedMessage(EntityBase *, APIConnection *, uint32_t, bool)> creator,