| 9 | namespace test { |
| 10 | class FastRunCache { |
| 11 | struct SearchItemStorage { |
| 12 | std::string data_hold; |
| 13 | size_t hash = 0; |
| 14 | |
| 15 | SearchItemStorage(const Algorithm::SearchItem& item); |
| 16 | |
| 17 | SearchItemStorage& init_hash() { |
| 18 | hash = XXHash64CT::hash(data_hold.data(), data_hold.size(), 20201225); |
| 19 | return *this; |
| 20 | } |
| 21 | |
| 22 | bool operator==(const SearchItemStorage& rhs) const { |
| 23 | return data_hold == rhs.data_hold; |
| 24 | } |
| 25 | |
| 26 | struct Hash { |
| 27 | size_t operator()(const SearchItemStorage& s) const { return s.hash; } |
| 28 | }; |
| 29 | }; |
| 30 | |
| 31 | std::unordered_map< |
| 32 | SearchItemStorage, Algorithm::Info::Desc, SearchItemStorage::Hash> |