46a47
> i++;
100a102
> // Nothing is on the list: add it and schedule an event
103a106,107
> transmitList.push_back(std::pair<Tick,PacketPtr>(time+curTick,pkt));
> return;
105c109,124
< transmitList.push_back(std::pair<Tick,PacketPtr>(time+curTick,pkt));
---
>
> // something is on the list and this belongs at the end
> if (time+curTick >= transmitList.back().first) {
> transmitList.push_back(std::pair<Tick,PacketPtr>(time+curTick,pkt));
> return;
> }
> // Something is on the list and this belongs somewhere else
> std::list<std::pair<Tick,PacketPtr> >::iterator i = transmitList.begin();
> std::list<std::pair<Tick,PacketPtr> >::iterator end = transmitList.end();
> bool done = false;
>
> while (i != end && !done) {
> if (time+curTick < i->first)
> transmitList.insert(i,std::pair<Tick,PacketPtr>(time+curTick,pkt));
> i++;
> }