summaryrefslogtreecommitdiff
path: root/sccomp
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-11-12 15:38:13 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-16 07:53:49 +0100
commitbf4bbc3c2174b21577b8878bc3197923ba44a029 (patch)
tree22ec4b4da1bc2b86b6b27776fd64fd2b89a9ed3e /sccomp
parentb977a8786ff39f1348bafdbf2dd83e7008ed3086 (diff)
replace std::max(std::min()) with std::clamp
Change-Id: I890d19f5e2177294dc1175c90c98b964347f9e85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105751 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sccomp')
-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);