AK: Mark some helper things constexpr.

This commit is contained in:
Andreas Kling 2019-06-24 10:13:28 +02:00
parent bf97b9589d
commit 2dd54f062a
2 changed files with 4 additions and 4 deletions

View file

@ -47,19 +47,19 @@ inline constexpr dword round_up_to_power_of_two(dword value, dword power_of_two)
namespace AK {
template<typename T>
inline T min(const T& a, const T& b)
inline constexpr T min(const T& a, const T& b)
{
return a < b ? a : b;
}
template<typename T>
inline T max(const T& a, const T& b)
inline constexpr T max(const T& a, const T& b)
{
return a < b ? b : a;
}
template<typename T, typename U>
static inline T ceil_div(T a, U b)
inline constexpr T ceil_div(T a, U b)
{
static_assert(sizeof(T) == sizeof(U));
T result = a / b;

View file

@ -66,7 +66,7 @@ private:
char m_inline_buffer[0];
};
inline dword string_hash(const char* characters, int length)
inline constexpr dword string_hash(const char* characters, int length)
{
dword hash = 0;
for (int i = 0; i < length; ++i) {