8266
This commit is contained in:
@@ -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_();
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user