AK: Allow clamp() with min==max

This commit is contained in:
Andreas Kling 2020-01-20 13:49:05 +01:00
parent e901a3695a
commit 2309029cb4
Notes: sideshowbarker 2024-07-19 09:56:19 +09:00

View file

@ -87,7 +87,7 @@ inline constexpr T max(const T& a, const T& b)
template<typename T>
inline constexpr T clamp(const T& value, const T& min, const T& max)
{
ASSERT(max > min);
ASSERT(max >= min);
if (value > max)
return max;
if (value < min)