mirror of
https://github.com/liquidraver/ZephCore.git
synced 2026-09-01 21:08:19 +00:00
simplify packet manager and dispatcher
This commit is contained in:
@@ -303,11 +303,10 @@ void Dispatcher::checkRecv()
|
||||
logRx(pkt, pkt->getRawLength(), score);
|
||||
if (pkt->isRouteFlood()) {
|
||||
n_recv_flood++;
|
||||
processRecvPacket(pkt);
|
||||
} else {
|
||||
n_recv_direct++;
|
||||
processRecvPacket(pkt);
|
||||
}
|
||||
processRecvPacket(pkt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,14 +46,7 @@ struct PacketQueue {
|
||||
}
|
||||
if (best_idx < 0) return nullptr;
|
||||
|
||||
Packet *top = _table[best_idx];
|
||||
for (int i = best_idx; i < _num - 1; i++) {
|
||||
_table[i] = _table[i + 1];
|
||||
_pri_table[i] = _pri_table[i + 1];
|
||||
_schedule_table[i] = _schedule_table[i + 1];
|
||||
}
|
||||
_num--;
|
||||
return top;
|
||||
return removeByIdx(best_idx);
|
||||
}
|
||||
|
||||
Packet *removeByIdx(int i) {
|
||||
|
||||
Reference in New Issue
Block a user