diff --git a/GeoLib/OctTree-impl.h b/GeoLib/OctTree-impl.h index 886fa38d1433248aa45c2876e3f2a04a3e42aa30..686580c55d72c02a26ae007beec4505c3accaec7 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;