Decompile fn_11892 (FrameTextHash::operator())
Batch #11094 by cremane: 1 byte-identical, 0 confirmed by peer review. - fn_11892 FrameTextHash::operator(): byte-identical Merged automatically: every function is byte-identical to the original.
This commit is contained in:
parent
0e37a76228
commit
5e63266d91
1 changed files with 3 additions and 21 deletions
|
|
@ -1,29 +1,11 @@
|
|||
#include "UI/Window/FrameTextCache.h"
|
||||
|
||||
namespace {
|
||||
// INLINED
|
||||
std::uint32_t HashWord(std::uint32_t value) {
|
||||
std::uint32_t hash = 0x811C9DC5u;
|
||||
|
||||
for (unsigned shift = 0; shift < 32; shift += 8) {
|
||||
hash = 16777619u * (hash ^ ((value >> shift) & 255));
|
||||
}
|
||||
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: 0x008C4CF0
|
||||
// FUNCTION: fn_11892
|
||||
std::size_t FrameTextHash::operator()(const FrameTextKey& key) const {
|
||||
std::uint32_t hash = 0x811C9DC5u;
|
||||
|
||||
for (unsigned char value : key.text) {
|
||||
hash = 16777619u * (hash ^ value);
|
||||
}
|
||||
|
||||
hash ^= HashWord(key.word1) + 0x9E3779B9u + (hash << 6) + (hash >> 2);
|
||||
hash ^= HashWord(key.word0) + 0x9E3779B9u + (hash << 6) + (hash >> 2);
|
||||
std::size_t hash = std::hash<std::string>()(key.text);
|
||||
hash ^= std::hash<std::uint32_t>()(key.word1) + 0x9E3779B9u + (hash << 6) + (hash >> 2);
|
||||
hash ^= std::hash<std::uint32_t>()(key.word0) + 0x9E3779B9u + (hash << 6) + (hash >> 2);
|
||||
return hash;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue