AK: Make min/max behave like the STL for equivalent inputs (#2976)

min(a, b) now returns a if both are equivalent.
max(a, b) now returns a if both are equivalent.
This commit is contained in:
Muhammad Zahalqa 2020-08-06 10:58:45 +03:00 committed by GitHub
parent 4b6036bc33
commit 9495eeb075
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: sideshowbarker 2024-07-19 04:14:57 +09:00

View file

@ -38,7 +38,7 @@ namespace AK {
template<typename T>
inline constexpr T min(const T& a, const T& b)
{
return a < b ? a : b;
return b < a ? b : a;
}
template<typename T>