AK: Add missing GenericTraits<u8>

This enables us to use keys of type u8 in HashMaps.
This commit is contained in:
devashish 2020-11-29 14:16:37 +05:30 committed by Andreas Kling
parent d4b2e89875
commit 0b252c31b2

View file

@ -54,6 +54,12 @@ struct Traits<unsigned> : public GenericTraits<unsigned> {
static unsigned hash(unsigned u) { return int_hash(u); }
};
template<>
struct Traits<u8> : public GenericTraits<u8> {
static constexpr bool is_trivial() { return true; }
static unsigned hash(u8 u) { return int_hash(u); }
};
template<>
struct Traits<u16> : public GenericTraits<u16> {
static constexpr bool is_trivial() { return true; }