diff --git a/core/math/convex_hull.cpp b/core/math/convex_hull.cpp index a03438a339c..02ce5a25892 100644 --- a/core/math/convex_hull.cpp +++ b/core/math/convex_hull.cpp @@ -658,7 +658,7 @@ private: Vector3 get_gd_normal(Face *p_face); - bool shift_face(Face *p_face, real_t p_amount, LocalVector p_stack); + bool shift_face(Face *p_face, real_t p_amount, LocalVector &p_stack); public: ~ConvexHullInternal() { @@ -1775,7 +1775,7 @@ real_t ConvexHullInternal::shrink(real_t p_amount, real_t p_clamp_amount) { return p_amount; } -bool ConvexHullInternal::shift_face(Face *p_face, real_t p_amount, LocalVector p_stack) { +bool ConvexHullInternal::shift_face(Face *p_face, real_t p_amount, LocalVector &p_stack) { Vector3 orig_shift = get_gd_normal(p_face) * -p_amount; if (scaling[0] != 0) { orig_shift[0] /= scaling[0]; diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index b74324ff297..fb5f9c9887d 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -361,8 +361,7 @@ bool VisualShaderGraphPlugin::is_node_has_parameter_instances_relatively(VisualS } } - LocalVector prev_connected_nodes; - visual_shader->get_prev_connected_nodes(p_type, p_node, prev_connected_nodes); + const LocalVector &prev_connected_nodes = visual_shader->get_prev_connected_nodes(p_type, p_node); for (const int &E : prev_connected_nodes) { result = is_node_has_parameter_instances_relatively(p_type, E); @@ -5012,8 +5011,7 @@ void VisualShaderEditor::_update_next_previews(int p_node_id) { } void VisualShaderEditor::_get_next_nodes_recursively(VisualShader::Type p_type, int p_node_id, LocalVector &r_nodes) const { - LocalVector next_connections; - visual_shader->get_next_connected_nodes(p_type, p_node_id, next_connections); + const LocalVector &next_connections = visual_shader->get_next_connected_nodes(p_type, p_node_id); for (int node_id : next_connections) { r_nodes.push_back(node_id); diff --git a/modules/navigation/godot_navigation_server.cpp b/modules/navigation/godot_navigation_server.cpp index ee9687cf3d2..f8fd0f70c6d 100644 --- a/modules/navigation/godot_navigation_server.cpp +++ b/modules/navigation/godot_navigation_server.cpp @@ -234,7 +234,7 @@ TypedArray GodotNavigationServer::map_get_links(RID p_map) const { const NavMap *map = map_owner.get_or_null(p_map); ERR_FAIL_COND_V(map == nullptr, link_rids); - const LocalVector links = map->get_links(); + const LocalVector &links = map->get_links(); link_rids.resize(links.size()); for (uint32_t i = 0; i < links.size(); i++) { @@ -248,7 +248,7 @@ TypedArray GodotNavigationServer::map_get_regions(RID p_map) const { const NavMap *map = map_owner.get_or_null(p_map); ERR_FAIL_COND_V(map == nullptr, regions_rids); - const LocalVector regions = map->get_regions(); + const LocalVector ®ions = map->get_regions(); regions_rids.resize(regions.size()); for (uint32_t i = 0; i < regions.size(); i++) { @@ -262,7 +262,7 @@ TypedArray GodotNavigationServer::map_get_agents(RID p_map) const { const NavMap *map = map_owner.get_or_null(p_map); ERR_FAIL_COND_V(map == nullptr, agents_rids); - const LocalVector agents = map->get_agents(); + const LocalVector &agents = map->get_agents(); agents_rids.resize(agents.size()); for (uint32_t i = 0; i < agents.size(); i++) { diff --git a/scene/resources/importer_mesh.cpp b/scene/resources/importer_mesh.cpp index 09738757fd4..9d0ac5929b9 100644 --- a/scene/resources/importer_mesh.cpp +++ b/scene/resources/importer_mesh.cpp @@ -620,9 +620,7 @@ void ImporterMesh::generate_lods(float p_normal_merge_angle, float p_normal_spli } if (!found) { - LocalVector new_group; - new_group.push_back(corner_idx); - normal_group_indices.push_back(new_group); + normal_group_indices.push_back({ corner_idx }); normal_group_averages.push_back(ray_normal); } } diff --git a/scene/resources/visual_shader.h b/scene/resources/visual_shader.h index 2838a49209d..62e194cd148 100644 --- a/scene/resources/visual_shader.h +++ b/scene/resources/visual_shader.h @@ -203,11 +203,11 @@ public: // internal methods _FORCE_INLINE_ Ref get_node_unchecked(Type p_type, int p_id) const { return graph[p_type].nodes[p_id].node; } - _FORCE_INLINE_ void get_next_connected_nodes(Type p_type, int p_id, LocalVector &r_list) const { - r_list = graph[p_type].nodes[p_id].next_connected_nodes; + _FORCE_INLINE_ const LocalVector &get_next_connected_nodes(Type p_type, int p_id) const { + return graph[p_type].nodes[p_id].next_connected_nodes; } - _FORCE_INLINE_ void get_prev_connected_nodes(Type p_type, int p_id, LocalVector &r_list) const { - r_list = graph[p_type].nodes[p_id].prev_connected_nodes; + _FORCE_INLINE_ const LocalVector &get_prev_connected_nodes(Type p_type, int p_id) const { + return graph[p_type].nodes[p_id].prev_connected_nodes; } Vector get_node_list(Type p_type) const;