LibGfx: Implement comparison operator and hash function for FourCC
This commit is contained in:
parent
9d1b54b436
commit
a01360832c
1 changed files with 13 additions and 0 deletions
|
|
@ -42,7 +42,20 @@ struct [[gnu::packed]] FourCC {
|
|||
| static_cast<u8>(cc[3]);
|
||||
}
|
||||
|
||||
bool operator<(FourCC const& other) const
|
||||
{
|
||||
return this->to_u32() < other.to_u32();
|
||||
}
|
||||
|
||||
char cc[4];
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
template<>
|
||||
struct AK::Traits<Gfx::FourCC> : public AK::DefaultTraits<Gfx::FourCC> {
|
||||
static unsigned hash(Gfx::FourCC const& key)
|
||||
{
|
||||
return key.to_u32();
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue