a bunch of allocation optimizations

This commit is contained in:
Green Sky
2024-12-02 13:08:47 +01:00
parent 741f1428d3
commit 5601ad91f5
6 changed files with 12 additions and 5 deletions

View File

@@ -255,6 +255,7 @@ bool NGCEXTEventProvider::parse_ft1_data_ack(
_DATA_HAVE(sizeof(e.transfer_id), std::cerr << "NGCEXT: packet too small, missing transfer_id\n"; return false)
e.transfer_id = data[curser++];
e.sequence_ids.reserve(std::max<int64_t>(data_size-curser, 1)/sizeof(uint16_t));
while (curser < data_size) {
_DATA_HAVE(sizeof(uint16_t), std::cerr << "NGCEXT: packet too small, missing seq_id\n"; return false)
uint16_t seq_id = data[curser++];