From f1b773c749f899e551f55b4734a663ba0cd1e629 Mon Sep 17 00:00:00 2001 From: Dmitri Naumov <github@naumov.de> Date: Mon, 4 Sep 2023 11:15:34 +0200 Subject: [PATCH] [GL] Use any_of replacing for-range loop --- GeoLib/OctTree-impl.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/GeoLib/OctTree-impl.h b/GeoLib/OctTree-impl.h index 886fa38d143..686580c55d7 100644 --- a/GeoLib/OctTree-impl.h +++ b/GeoLib/OctTree-impl.h @@ -303,12 +303,11 @@ void OctTree<POINT, MAX_POINTS>::splitNode(POINT* pnt) const std::size_t n_pnts(_pnts.size()); for (std::size_t j(0); j < n_pnts; j++) { - for (auto c : _children) + if (std::any_of(begin(_children), end(_children), + [&](auto* child) + { return child->addPointToChild(_pnts[j]); })) { - if (c->addPointToChild(_pnts[j])) - { - break; - } + continue; } } _is_leaf = false; -- GitLab