From b98ace58309d4c8433478a6c1f6708e1ab5ae1d4 Mon Sep 17 00:00:00 2001 From: "Shashidhara K. Ganjugunte" Date: Sat, 3 Feb 2024 18:47:46 -0800 Subject: [PATCH] Used DISPATCH_FLOAT_INT_DTYPE_TO_TEMPLATE macro. Instead of using if statements explicitly, used DISPATCH_FLOAT_INT_DTYPE_TO_TEMPLATE to dispatch to RemoveDuplicateVerticesWorker function appropriately. On branch sganjugu/remdup2 Your branch is up to date with 'origin/sganjugu/remdup2'. Changes to be committed: modified: ../cpp/open3d/t/geometry/TriangleMesh.cpp --- cpp/open3d/t/geometry/TriangleMesh.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/cpp/open3d/t/geometry/TriangleMesh.cpp b/cpp/open3d/t/geometry/TriangleMesh.cpp index a32ef17840a..ae5694f1f0b 100644 --- a/cpp/open3d/t/geometry/TriangleMesh.cpp +++ b/cpp/open3d/t/geometry/TriangleMesh.cpp @@ -1383,19 +1383,10 @@ TriangleMesh &TriangleMesh::RemoveDuplicateVertices() { return *this; } - if (core::Float32 == vertices.GetDtype()) { - if (core::Int32 == triangle_dtype) { - return RemoveDuplicateVerticesWorker(*this); - } else { - return RemoveDuplicateVerticesWorker(*this); - } - } else { - if (core::Int32 == triangle_dtype) { - return RemoveDuplicateVerticesWorker(*this); - } else { - return RemoveDuplicateVerticesWorker(*this); - } - } + DISPATCH_FLOAT_INT_DTYPE_TO_TEMPLATE( + vertices.GetDtype(), triangle_dtype, + [&]() { RemoveDuplicateVerticesWorker(*this); }); + return *this; } } // namespace geometry