mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 01:41:59 -05:00
AK: Mark some helper things constexpr.
This commit is contained in:
parent
bf97b9589d
commit
2dd54f062a
2 changed files with 4 additions and 4 deletions
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue