mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibGfx: Add hash traits for the Size family
This commit is contained in:
parent
11b4216e65
commit
2484324f9a
Notes:
sideshowbarker
2024-07-16 20:39:14 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/2484324f9a Pull-request: https://github.com/SerenityOS/serenity/pull/23328 Reviewed-by: https://github.com/tcl3
1 changed files with 9 additions and 0 deletions
|
@ -220,3 +220,12 @@ template<>
|
|||
ErrorOr<Gfx::IntSize> decode(Decoder&);
|
||||
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
struct AK::Traits<Gfx::Size<T>> : public AK::DefaultTraits<Gfx::Size<T>> {
|
||||
static constexpr bool is_trivial() { return false; }
|
||||
static unsigned hash(Gfx::Size<T> const& size)
|
||||
{
|
||||
return pair_int_hash(AK::Traits<T>::hash(size.width()), AK::Traits<T>::hash(size.height()));
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue