From 2dd54f062ab6d966c71e49052b16066863a6feaf Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 24 Jun 2019 10:13:28 +0200 Subject: [PATCH] AK: Mark some helper things constexpr. --- AK/StdLibExtras.h | 6 +++--- AK/StringImpl.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/AK/StdLibExtras.h b/AK/StdLibExtras.h index 2e132a5a1e..a1cf752157 100644 --- a/AK/StdLibExtras.h +++ b/AK/StdLibExtras.h @@ -47,19 +47,19 @@ inline constexpr dword round_up_to_power_of_two(dword value, dword power_of_two) namespace AK { template -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 -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 -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; diff --git a/AK/StringImpl.h b/AK/StringImpl.h index dbeb9d5ecf..b39e363750 100644 --- a/AK/StringImpl.h +++ b/AK/StringImpl.h @@ -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) {