Sketcher: apply std::ranges

This commit is contained in:
bofdahof
2025-03-12 20:03:13 +10:00
committed by Chris Hennes
parent 2ddd24bc6d
commit fb71aa3292
11 changed files with 210 additions and 309 deletions

View File

@@ -570,13 +570,12 @@ void EditModeCoinManager::drawEditMarkers(const std::vector<Base::Vector2d>& Edi
auto supportedsizes = Gui::Inventor::MarkerBitmaps::getSupportedSizes("CIRCLE_LINE");
auto defaultmarker =
std::find(supportedsizes.begin(), supportedsizes.end(), drawingParameters.markerSize);
const auto defaultmarker = std::ranges::find(supportedsizes, drawingParameters.markerSize);
if (defaultmarker != supportedsizes.end()) {
auto validAugmentationLevels = std::distance(defaultmarker, supportedsizes.end());
if (augmentationlevel >= validAugmentationLevels) {
if (const auto validAugmentationLevels = std::distance(defaultmarker, supportedsizes.end());
augmentationlevel >= validAugmentationLevels) {
augmentationlevel = validAugmentationLevels - 1;
}