1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Use range iterators for RBSet in most cases

This commit is contained in:
Aaron Record
2022-05-18 17:43:40 -06:00
parent 71c40ff4da
commit 900c676b02
84 changed files with 782 additions and 782 deletions

View File

@@ -214,17 +214,17 @@ bool SceneCacheInterface::send_object_cache(Object *p_obj, NodePath p_path, int
}
} else {
// Long and painful.
for (const RBSet<int>::Element *E = multiplayer->get_connected_peers().front(); E; E = E->next()) {
if (p_peer_id < 0 && E->get() == -p_peer_id) {
for (const int &E : multiplayer->get_connected_peers()) {
if (p_peer_id < 0 && E == -p_peer_id) {
continue; // Continue, excluded.
}
if (p_peer_id > 0 && E->get() != p_peer_id) {
if (p_peer_id > 0 && E != p_peer_id) {
continue; // Continue, not for this peer.
}
HashMap<int, bool>::Iterator F = psc->confirmed_peers.find(E->get());
HashMap<int, bool>::Iterator F = psc->confirmed_peers.find(E);
if (!F) {
peers_to_add.push_back(E->get()); // Need to also be notified.
peers_to_add.push_back(E); // Need to also be notified.
has_all_peers = false;
} else if (!F->value) {
has_all_peers = false;