summaryrefslogtreecommitdiff
path: root/sccomp/source/solver/SwarmSolver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sccomp/source/solver/SwarmSolver.cxx')
-rw-r--r--sccomp/source/solver/SwarmSolver.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sccomp/source/solver/SwarmSolver.cxx b/sccomp/source/solver/SwarmSolver.cxx
index d59df283441c..a55f410b4f10 100644
--- a/sccomp/source/solver/SwarmSolver.cxx
+++ b/sccomp/source/solver/SwarmSolver.cxx
@@ -373,7 +373,7 @@ void SwarmSolver::initializeVariables(std::vector<double>& rVariables, std::mt19
double SwarmSolver::clampVariable(size_t nVarIndex, double fValue)
{
Bound const& rBound = maBounds[nVarIndex];
- double fResult = std::max(std::min(fValue, rBound.upper), rBound.lower);
+ double fResult = std::clamp(fValue, rBound.lower, rBound.upper);
if (mbInteger)
return std::trunc(fResult);