Use C++ iterators for Lists in many situations

This commit is contained in:
Aaron Franke 2021-07-15 23:45:57 -04:00
parent b918c4c3ce
commit 4e6efd1b07
No known key found for this signature in database
GPG key ID: 40A1750B977E56BF
218 changed files with 2755 additions and 3004 deletions

View file

@ -65,9 +65,9 @@ void WebSocketMultiplayerPeer::_clear() {
memfree(_current_packet.data);
}
for (List<Packet>::Element *E = _incoming_packets.front(); E; E = E->next()) {
memfree(E->get().data);
E->get().data = nullptr;
for (Packet &E : _incoming_packets) {
memfree(E.data);
E.data = nullptr;
}
_incoming_packets.clear();