From 8c25bcdb8484e1cfd0a2d14398a3423d2df9b4c5 Mon Sep 17 00:00:00 2001 From: bitsawer Date: Wed, 25 Jan 2023 23:17:53 +0200 Subject: [PATCH] Fix range loop iteration regressions --- core/math/geometry_3d.cpp | 2 +- servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/math/geometry_3d.cpp b/core/math/geometry_3d.cpp index 47861100544..590483bf202 100644 --- a/core/math/geometry_3d.cpp +++ b/core/math/geometry_3d.cpp @@ -151,7 +151,7 @@ void Geometry3D::MeshData::optimize_vertices() { } } - for (MeshData::Edge edge : edges) { + for (MeshData::Edge &edge : edges) { int a = edge.vertex_a; int b = edge.vertex_b; diff --git a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp index 46a0d85ba86..2015a2fca01 100644 --- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp @@ -842,7 +842,7 @@ void MeshStorage::mesh_instance_set_blend_shape_weight(RID p_mesh_instance, int } void MeshStorage::_mesh_instance_clear(MeshInstance *mi) { - for (const RendererRD::MeshStorage::MeshInstance::Surface surface : mi->surfaces) { + for (const RendererRD::MeshStorage::MeshInstance::Surface &surface : mi->surfaces) { if (surface.versions) { for (uint32_t j = 0; j < surface.version_count; j++) { RD::get_singleton()->free(surface.versions[j].vertex_array);