From 900c676b0282bed83d00834e3c280ac89c2bc94d Mon Sep 17 00:00:00 2001 From: Aaron Record Date: Wed, 18 May 2022 17:43:40 -0600 Subject: Use range iterators for RBSet in most cases --- modules/gridmap/grid_map.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'modules/gridmap') diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index 9da137f9d5..c70a8121e8 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -483,15 +483,15 @@ bool GridMap::_octant_update(const OctantKey &p_key) { HashMap>> multimesh_items; - for (RBSet::Element *E = g.cells.front(); E; E = E->next()) { - ERR_CONTINUE(!cell_map.has(E->get())); - const Cell &c = cell_map[E->get()]; + for (const IndexKey &E : g.cells) { + ERR_CONTINUE(!cell_map.has(E)); + const Cell &c = cell_map[E]; if (!mesh_library.is_valid() || !mesh_library->has_item(c.item)) { continue; } - Vector3 cellpos = Vector3(E->get().x, E->get().y, E->get().z); + Vector3 cellpos = Vector3(E.x, E.y, E.z); Vector3 ofs = _get_offset(); Transform3D xform; @@ -507,7 +507,7 @@ bool GridMap::_octant_update(const OctantKey &p_key) { Pair p; p.first = xform * mesh_library->get_item_mesh_transform(c.item); - p.second = E->get(); + p.second = E; multimesh_items[c.item].push_back(p); } } @@ -540,7 +540,7 @@ bool GridMap::_octant_update(const OctantKey &p_key) { nm.region = region; } - g.navmesh_ids[E->get()] = nm; + g.navmesh_ids[E] = nm; } } -- cgit v1.2.3