mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 18:02:20 +00:00
AK: Add a u64 Trait type
This allows u64s to be used in HashMaps.
This commit is contained in:
parent
9e22b83343
commit
d5fea1b235
Notes:
sideshowbarker
2024-07-19 10:21:27 +09:00
Author: https://github.com/shannonbooth
Commit: d5fea1b235
Pull-request: https://github.com/SerenityOS/serenity/pull/1009
2 changed files with 14 additions and 0 deletions
|
@ -17,3 +17,10 @@ inline unsigned pair_int_hash(u32 key1, u32 key2)
|
|||
{
|
||||
return int_hash((int_hash(key1) * 209) ^ (int_hash(key2 * 413)));
|
||||
}
|
||||
|
||||
inline unsigned u64_hash(u64 key)
|
||||
{
|
||||
u32 first = key & 0xFFFFFFFF;
|
||||
u32 last = key >> 32;
|
||||
return pair_int_hash(first, last);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue