From eda50c13b0d3f9c4d198e7559aaf91a991633958 Mon Sep 17 00:00:00 2001 From: xtemp09 Date: Wed, 8 Mar 2023 17:38:11 +0700 Subject: [PATCH] [Mesh] Minor code update Removal of unnecessary comparison. `QThread::idealThreadCount()` returns the ideal number of threads that the process can run in parallel or 1 if it fails to determine it. --- src/Mod/Mesh/App/Core/Builder.cpp | 2 +- src/Mod/Mesh/App/Core/Evaluation.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/Mesh/App/Core/Builder.cpp b/src/Mod/Mesh/App/Core/Builder.cpp index 18101c2e7a..898cd4d95b 100644 --- a/src/Mod/Mesh/App/Core/Builder.cpp +++ b/src/Mod/Mesh/App/Core/Builder.cpp @@ -336,7 +336,7 @@ void MeshFastBuilder::Finish () } //std::sort(verts.begin(), verts.end()); - int threads = std::max(1, QThread::idealThreadCount()); + int threads = QThread::idealThreadCount(); MeshCore::parallel_sort(verts.begin(), verts.end(), std::less(), threads); QVector indices(ulCtPts); diff --git a/src/Mod/Mesh/App/Core/Evaluation.cpp b/src/Mod/Mesh/App/Core/Evaluation.cpp index e702621f13..4186dde2b9 100644 --- a/src/Mod/Mesh/App/Core/Evaluation.cpp +++ b/src/Mod/Mesh/App/Core/Evaluation.cpp @@ -966,7 +966,7 @@ void MeshKernel::RebuildNeighbours (FacetIndex index) // sort the edges //std::sort(edges.begin(), edges.end(), Edge_Less()); - int threads = std::max(1, QThread::idealThreadCount()); + int threads = QThread::idealThreadCount(); MeshCore::parallel_sort(edges.begin(), edges.end(), Edge_Less(), threads); PointIndex p0 = POINT_INDEX_MAX, p1 = POINT_INDEX_MAX;