-
-
Save andrewc12/73d33bf694b5eeb2af38e3a59f77e2e7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace std | |
| { | |
| // Needed to use ESM::FormId as a key in std::unordered_map | |
| template <> | |
| struct hash<ESM::FormId> | |
| { | |
| size_t operator()(const ESM::FormId& formId) const | |
| { | |
| // Hash each member and combine them | |
| size_t h1 = std::hash<uint32_t>()(formId.mIndex); | |
| size_t h2 = std::hash<int32_t>()(formId.mContentFile); | |
| // Combine the hashes of mIndex and mContentFile | |
| return h1 ^ (h2 << 1); // XOR with shift to create a combined hash | |
| } | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment