This commit is contained in:
J. Nick Koston 2025-07-01 11:57:02 -05:00
parent b000b1b70c
commit c33c14a46f
No known key found for this signature in database

View File

@ -517,7 +517,7 @@ class APIConnection : public APIServerConnection {
private: private:
// Helper to cleanup items from the beginning // Helper to cleanup items from the beginning
void cleanup_items(size_t count) { void cleanup_items_(size_t count) {
for (size_t i = 0; i < count; i++) { for (size_t i = 0; i < count; i++) {
items[i].creator.cleanup(items[i].message_type); items[i].creator.cleanup(items[i].message_type);
} }
@ -541,14 +541,14 @@ class APIConnection : public APIServerConnection {
// Clear all items with proper cleanup // Clear all items with proper cleanup
void clear() { void clear() {
cleanup_items(items.size()); cleanup_items_(items.size());
items.clear(); items.clear();
batch_start_time = 0; batch_start_time = 0;
} }
// Remove processed items from the front with proper cleanup // Remove processed items from the front with proper cleanup
void remove_front(size_t count) { void remove_front(size_t count) {
cleanup_items(count); cleanup_items_(count);
items.erase(items.begin(), items.begin() + count); items.erase(items.begin(), items.begin() + count);
} }