[Sketcher] [WIP] One curious refactor I'm not certain about

Possibly reduces "cognitive complexity", but is it really too much clearer?
This commit is contained in:
Ajinkya Dahale
2025-04-10 20:46:17 +05:30
committed by Benjamin Nauck
parent 6cf63b078e
commit 4ee40f4c49

View File

@@ -674,10 +674,11 @@ protected:
// find if there is already a matching tangency
auto itOfTangentConstraint = AutoConstraints.end();
if (isStartOrEnd(posId1) && isStartOrEnd(posId2)) {
itOfTangentConstraint =
std::ranges::find_if(AutoConstraints, [&](const auto& ace) {
return ace->Type == Sketcher::Tangent && ace->First == geoId1
&& ace->Second == geoId2;
itOfTangentConstraint = std::ranges::find(
AutoConstraints,
std::tuple {Sketcher::Tangent, geoId1, geoId2},
[](const auto& ace) {
return std::tuple {ace->Type, ace->First, ace->Second};
});
}