From fb9a71bd6a1e7dba39a894440ecfa540e10d604f Mon Sep 17 00:00:00 2001 From: Sahan Fernando Date: Mon, 14 Dec 2020 10:53:47 +1100 Subject: AK: Add hash implementations for i16 and i64 --- AK/Traits.h | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'AK/Traits.h') diff --git a/AK/Traits.h b/AK/Traits.h index e3b7c1ac66..281c174af1 100644 --- a/AK/Traits.h +++ b/AK/Traits.h @@ -48,6 +48,24 @@ struct Traits : public GenericTraits { static unsigned hash(int i) { return int_hash(i); } }; +template<> +struct Traits : public GenericTraits { + static constexpr bool is_trivial() { return true; } + static unsigned hash(char c) { return int_hash(c); } +}; + +template<> +struct Traits : public GenericTraits { + static constexpr bool is_trivial() { return true; } + static unsigned hash(i16 i) { return int_hash(i); } +}; + +template<> +struct Traits : public GenericTraits { + static constexpr bool is_trivial() { return true; } + static unsigned hash(i64 i) { return u64_hash(i); } +}; + template<> struct Traits : public GenericTraits { static constexpr bool is_trivial() { return true; } @@ -72,12 +90,6 @@ struct Traits : public GenericTraits { static unsigned hash(u64 u) { return u64_hash(u); } }; -template<> -struct Traits : public GenericTraits { - static constexpr bool is_trivial() { return true; } - static unsigned hash(char c) { return int_hash(c); } -}; - template struct Traits : public GenericTraits { static unsigned hash(const T* p) -- cgit v1.2.3