From ad9671c3d71f7bea55c3a36fc4fcca7d55f88258 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 25 May 2024 15:34:58 +0100 Subject: Remove abuse of std::adjacent_find from cylinder --- assetFactory/cylinder.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'assetFactory') diff --git a/assetFactory/cylinder.cpp b/assetFactory/cylinder.cpp index fd96c8b..f41bfd4 100644 --- a/assetFactory/cylinder.cpp +++ b/assetFactory/cylinder.cpp @@ -1,6 +1,7 @@ #include "cylinder.h" #include "maths.h" #include "modelFactoryMesh.h" +#include Cylinder::CreatedFaces Cylinder::createMesh(ModelFactoryMesh & mesh, Scale3D lodf) const @@ -40,13 +41,12 @@ Cylinder::createMesh(ModelFactoryMesh & mesh, Scale3D lodf) const // Wrap around edge.back() = edge.front(); // Transform adjacent pairs of top/bottom pairs to faces - std::adjacent_find(edge.begin(), edge.end(), [&mesh, &surface](const auto & first, const auto & second) { + for (const auto & [first, second] : edge | std::views::adjacent<2>) { const auto fh = surface.insert(mesh.add_namedFace("edge", first.first, first.second, second.second, second.first)) ->second; mesh.property(mesh.smoothFaceProperty, fh) = true; - return false; - }); + } } return surface; -- cgit v1.2.3