From 97d1149c3bd237584dbd10ee22b6fe707d1ae03b Mon Sep 17 00:00:00 2001 From: lupoDharkael Date: Wed, 11 Mar 2020 00:14:29 +0100 Subject: [PATCH] Mesh::convex_decompose: Remove unneeded vector copy --- scene/resources/mesh.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index a063b7f74fb..27016db14d1 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -543,15 +543,9 @@ Vector > Mesh::convex_decompose() const { ERR_FAIL_COND_V(!convex_composition_function, Vector >()); - Vector faces = get_faces(); - Vector f3; - f3.resize(faces.size()); - const Face3 *f = faces.ptr(); - for (int i = 0; i < f3.size(); i++) { - f3.write[i] = f[i]; - } + const Vector faces = get_faces(); - Vector > decomposed = convex_composition_function(f3); + Vector > decomposed = convex_composition_function(faces); Vector > ret;