1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-19 14:31:59 +00:00

Using iterator pattern instead of List::Element *.

Co-authored-by: Adam Scott <ascott.ca@gmail.com>
This commit is contained in:
Yyf2333
2025-02-03 14:16:27 +08:00
committed by Yufeng Ying
parent 594d64ec24
commit 22b5ec17fb
36 changed files with 150 additions and 173 deletions

View File

@@ -72,8 +72,8 @@ Error ENetConnection::create_host(int p_max_peers, int p_max_channels, int p_in_
void ENetConnection::destroy() {
ERR_FAIL_NULL_MSG(host, "Host already destroyed.");
for (List<Ref<ENetPacketPeer>>::Element *E = peers.front(); E; E = E->next()) {
E->get()->_on_disconnect();
for (const Ref<ENetPacketPeer> &peer : peers) {
peer->_on_disconnect();
}
peers.clear();
enet_host_destroy(host);