From c63b18507d21b8a213c073bced9057b571cdcd7a Mon Sep 17 00:00:00 2001 From: Lightning_A Date: Mon, 9 Aug 2021 14:13:42 -0600 Subject: Use range iterators for `Map` --- servers/physics_2d/shape_2d_sw.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'servers/physics_2d') diff --git a/servers/physics_2d/shape_2d_sw.cpp b/servers/physics_2d/shape_2d_sw.cpp index b5953bfdaf..bde882ac24 100644 --- a/servers/physics_2d/shape_2d_sw.cpp +++ b/servers/physics_2d/shape_2d_sw.cpp @@ -36,8 +36,8 @@ void Shape2DSW::configure(const Rect2 &p_aabb) { aabb = p_aabb; configured = true; - for (Map::Element *E = owners.front(); E; E = E->next()) { - ShapeOwner2DSW *co = (ShapeOwner2DSW *)E->key(); + for (const KeyValue &E : owners) { + ShapeOwner2DSW *co = (ShapeOwner2DSW *)E.key; co->_shape_changed(); } } @@ -875,9 +875,9 @@ void ConcavePolygonShape2DSW::set_data(const Variant &p_data) { points.resize(pointmap.size()); aabb.position = pointmap.front()->key(); - for (Map::Element *E = pointmap.front(); E; E = E->next()) { - aabb.expand_to(E->key()); - points.write[E->get()] = E->key(); + for (const KeyValue &E : pointmap) { + aabb.expand_to(E.key); + points.write[E.value] = E.key; } Vector main_vbh; -- cgit v1.2.3