From 258f700b2d7f13fb902d3cc8495ac2b4d8eda015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 18 Aug 2023 13:14:16 +0200 Subject: [PATCH] MeshTools: remove a confusing std::move() in removeDuplicatesFuzzy(). Add a TODO instead, as the move *might* make sense with a MeshData&& overload to reduce peak memory use. --- src/Magnum/MeshTools/RemoveDuplicates.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Magnum/MeshTools/RemoveDuplicates.cpp b/src/Magnum/MeshTools/RemoveDuplicates.cpp index 5fbabe664..3676de5ec 100644 --- a/src/Magnum/MeshTools/RemoveDuplicates.cpp +++ b/src/Magnum/MeshTools/RemoveDuplicates.cpp @@ -471,10 +471,12 @@ Trade::MeshData removeDuplicatesFuzzy(const Trade::MeshData& mesh, const Float f "MeshTools::removeDuplicatesFuzzy(): can't remove duplicates in an attributeless mesh", (Trade::MeshData{MeshPrimitive::Points, 0})); - /* Turn the passed data into an owned mutable instance we can operate on. - There's a chance the original data are already like this, in which case - this will be just a passthrough. */ - Trade::MeshData owned = copy(std::move(mesh)); + /* Turn the passed data into an owned mutable instance we can operate on */ + /** @todo even though the output is always copied as a result of merging + the index arrays, it might still be useful to provide a MeshData&& + overload that doesn't perform this initial copy and operates on the + original in-place to save some memory */ + Trade::MeshData owned = copy(mesh); /* Allocate an interleaved index array for all vertices times all attributes */