diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-03-11 15:12:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-11 15:12:15 +0100 |
commit | 98cdf50a5591e7629bde7688ceda82b15bd9e858 (patch) | |
tree | 81db39068a090bb2811390f370a08bb513d41ff0 /scene | |
parent | 153a2b094c4568b0702ef6da29c35754ba24c2b3 (diff) | |
parent | 97d1149c3bd237584dbd10ee22b6fe707d1ae03b (diff) |
Merge pull request #36977 from lupoDharkael/decompose-copy
Mesh::convex_decompose: Remove unneeded vector copy
Diffstat (limited to 'scene')
-rw-r--r-- | scene/resources/mesh.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index 1caeddd881..5e032c41bf 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -545,15 +545,9 @@ Vector<Ref<Shape> > Mesh::convex_decompose() const { ERR_FAIL_COND_V(!convex_composition_function, Vector<Ref<Shape> >()); - Vector<Face3> faces = get_faces(); - Vector<Face3> 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<Face3> faces = get_faces(); - Vector<Vector<Face3> > decomposed = convex_composition_function(f3); + Vector<Vector<Face3> > decomposed = convex_composition_function(faces); Vector<Ref<Shape> > ret; |