Browse Source

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.
Muhammad Zahalqa 5 years ago
parent
commit
9495eeb075
1 changed files with 1 additions and 1 deletions
  1. 1 1
      AK/StdLibExtras.h

+ 1 - 1
AK/StdLibExtras.h

@@ -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>