mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
AK: Allow clamp() with min==max
This commit is contained in:
parent
e901a3695a
commit
2309029cb4
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue