diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-09-30 23:52:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-30 23:52:46 +0200 |
commit | 77721b35ba21f2e7e8bb42cf415fccb018517843 (patch) | |
tree | 96b8f7532ae5d923b75bfbac8d6763015b6646bb /modules/navigation | |
parent | 3e1b6304613855cad56938e8a58848f09363a298 (diff) | |
parent | c63b18507d21b8a213c073bced9057b571cdcd7a (diff) |
Merge pull request #51409 from LightningAA/use-map-iterators
Use range iterators for `Map` in most cases
Diffstat (limited to 'modules/navigation')
-rw-r--r-- | modules/navigation/nav_map.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp index 962bf79150..0c8f0ed8c9 100644 --- a/modules/navigation/nav_map.cpp +++ b/modules/navigation/nav_map.cpp @@ -613,17 +613,17 @@ void NavMap::sync() { } Vector<gd::Edge::Connection> free_edges; - for (Map<gd::EdgeKey, Vector<gd::Edge::Connection>>::Element *E = connections.front(); E; E = E->next()) { - if (E->get().size() == 2) { + for (KeyValue<gd::EdgeKey, Vector<gd::Edge::Connection>> &E : connections) { + if (E.value.size() == 2) { // Connect edge that are shared in different polygons. - gd::Edge::Connection &c1 = E->get().write[0]; - gd::Edge::Connection &c2 = E->get().write[1]; + gd::Edge::Connection &c1 = E.value.write[0]; + gd::Edge::Connection &c2 = E.value.write[1]; c1.polygon->edges[c1.edge].connections.push_back(c2); c2.polygon->edges[c2.edge].connections.push_back(c1); // Note: The pathway_start/end are full for those connection and do not need to be modified. } else { - CRASH_COND_MSG(E->get().size() != 1, vformat("Number of connection != 1. Found: %d", E->get().size())); - free_edges.push_back(E->get()[0]); + CRASH_COND_MSG(E.value.size() != 1, vformat("Number of connection != 1. Found: %d", E.value.size())); + free_edges.push_back(E.value[0]); } } |