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` --- modules/csg/csg.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/csg') 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 &p_vertices, const Vector< } materials.resize(material_map.size()); - for (Map, int>::Element *E = material_map.front(); E; E = E->next()) { - materials.write[E->get()] = E->key(); + for (const KeyValue, 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, int>::Element *E = mesh_merge.materials.front(); E; E = E->next()) { - r_merged_brush.materials.write[E->get()] = E->key(); + for (const KeyValue, int> &E : mesh_merge.materials) { + r_merged_brush.materials.write[E.value] = E.key; } } -- cgit v1.2.3