From 2dca414464e1e040f7c65ff533419916586f61b2 Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Mon, 11 Mar 2024 20:56:15 -0500 Subject: [PATCH] policy_cache.hpp --- src/policy_cache.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/policy_cache.hpp b/src/policy_cache.hpp index 5de1cfb8..9cfeac4e 100644 --- a/src/policy_cache.hpp +++ b/src/policy_cache.hpp @@ -44,6 +44,7 @@ public: insert(std::string const &key_, std::string const &val_) { + uint64_t hash; // while(_cache.size() > _max_size) // { // std::string key; @@ -59,7 +60,9 @@ public: fmt::print("insert {}={}\n", key_, val_); - _cache.insert_or_assign(key_,val_); + + hash = wyhash(key_.c_str(),key_.size(),0xdeadbeef,_wyp); + _cache.insert_or_assign(hash,val_); } const