AK: Add hash implementations for i16 and i64

This commit is contained in:
Sahan Fernando 2020-12-14 10:53:47 +11:00 committed by Andreas Kling
parent 3d02597316
commit fb9a71bd6a

View file

@ -48,6 +48,24 @@ struct Traits<int> : public GenericTraits<int> {
static unsigned hash(int i) { return int_hash(i); }
};
template<>
struct Traits<char> : public GenericTraits<char> {
static constexpr bool is_trivial() { return true; }
static unsigned hash(char c) { return int_hash(c); }
};
template<>
struct Traits<i16> : public GenericTraits<i16> {
static constexpr bool is_trivial() { return true; }
static unsigned hash(i16 i) { return int_hash(i); }
};
template<>
struct Traits<i64> : public GenericTraits<i64> {
static constexpr bool is_trivial() { return true; }
static unsigned hash(i64 i) { return u64_hash(i); }
};
template<>
struct Traits<unsigned> : public GenericTraits<unsigned> {
static constexpr bool is_trivial() { return true; }
@ -72,12 +90,6 @@ struct Traits<u64> : public GenericTraits<u64> {
static unsigned hash(u64 u) { return u64_hash(u); }
};
template<>
struct Traits<char> : public GenericTraits<char> {
static constexpr bool is_trivial() { return true; }
static unsigned hash(char c) { return int_hash(c); }
};
template<typename T>
struct Traits<T*> : public GenericTraits<T*> {
static unsigned hash(const T* p)