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 /servers/physics_2d/shape_2d_sw.cpp | |
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 'servers/physics_2d/shape_2d_sw.cpp')
-rw-r--r-- | servers/physics_2d/shape_2d_sw.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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<ShapeOwner2DSW *, int>::Element *E = owners.front(); E; E = E->next()) { - ShapeOwner2DSW *co = (ShapeOwner2DSW *)E->key(); + for (const KeyValue<ShapeOwner2DSW *, int> &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<Point2, int>::Element *E = pointmap.front(); E; E = E->next()) { - aabb.expand_to(E->key()); - points.write[E->get()] = E->key(); + for (const KeyValue<Point2, int> &E : pointmap) { + aabb.expand_to(E.key); + points.write[E.value] = E.key; } Vector<BVH> main_vbh; |