From 015c8bba99827654416b7c8cddeaa469beae8377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 13 May 2023 23:54:11 +0200 Subject: [PATCH] MeshTools: remove obsolete TODO in copy(), tighten the checks a bit. --- src/Magnum/MeshTools/Copy.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Magnum/MeshTools/Copy.cpp b/src/Magnum/MeshTools/Copy.cpp index 23ecba51d..97a34d0a0 100644 --- a/src/Magnum/MeshTools/Copy.cpp +++ b/src/Magnum/MeshTools/Copy.cpp @@ -85,13 +85,11 @@ Trade::MeshData copy(const Trade::MeshData& mesh) { } Trade::MeshData copy(Trade::MeshData&& mesh) { - /** @todo copy only the actually used range instead of the whole thing? */ - - /* If index data are already owned, move them to the output. This works - without any extra effort also for non-indexed meshes. */ + /* Transfer index data if they're owned and mutable. This works without any + extra effort also for non-indexed meshes. */ Containers::Array indexData; Trade::MeshIndexData indices; - if(mesh.indexDataFlags() & Trade::DataFlag::Owned) { + if(mesh.indexDataFlags() >= (Trade::DataFlag::Owned|Trade::DataFlag::Mutable)) { indices = Trade::MeshIndexData{mesh.indices()}; indexData = mesh.releaseIndexData();