Use std::clamp() instead of various custom implementations

PR #19501.
This commit is contained in:
Victor Chernyakin 2023-08-27 11:55:08 -07:00 committed by GitHub
parent d8a03cd8d8
commit e045b4678d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 10 deletions

View file

@ -266,11 +266,7 @@ namespace
{
return [lower, upper](const T value) -> T
{
if (value < lower)
return lower;
if (value > upper)
return upper;
return value;
return std::clamp(value, lower, upper);
};
}