Skip to content

Commit

Permalink
MeshTools: remove a confusing std::move() in removeDuplicatesFuzzy().
Browse files Browse the repository at this point in the history
Add a TODO instead, as the move *might* make sense with a MeshData&&
overload to reduce peak memory use.
  • Loading branch information
mosra committed Aug 18, 2023
1 parent 8d023a7 commit 258f700
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Magnum/MeshTools/RemoveDuplicates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 258f700

Please sign in to comment.