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/csg | |
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/csg')
-rw-r--r-- | modules/csg/csg.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/csg/csg.cpp b/modules/csg/csg.cpp index 229e1e2724..53694035dc 100644 --- a/modules/csg/csg.cpp +++ b/modules/csg/csg.cpp @@ -258,8 +258,8 @@ void CSGBrush::build_from_faces(const Vector<Vector3> &p_vertices, const Vector< } materials.resize(material_map.size()); - for (Map<Ref<Material>, int>::Element *E = material_map.front(); E; E = E->next()) { - materials.write[E->get()] = E->key(); + for (const KeyValue<Ref<Material>, int> &E : material_map) { + materials.write[E.value] = E.key; } _regen_face_aabbs(); @@ -457,8 +457,8 @@ void CSGBrushOperation::merge_brushes(Operation p_operation, const CSGBrush &p_b // Update the list of materials. r_merged_brush.materials.resize(mesh_merge.materials.size()); - for (const Map<Ref<Material>, int>::Element *E = mesh_merge.materials.front(); E; E = E->next()) { - r_merged_brush.materials.write[E->get()] = E->key(); + for (const KeyValue<Ref<Material>, int> &E : mesh_merge.materials) { + r_merged_brush.materials.write[E.value] = E.key; } } |