From 4fbb8cd232a805b56083b6e427b8df57d304a62a Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Thu, 14 Mar 2024 23:48:06 -0500 Subject: [PATCH] policy_cache.hpp --- src/policy_cache.hpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/policy_cache.hpp b/src/policy_cache.hpp index b73eda5a..fb31f4b7 100644 --- a/src/policy_cache.hpp +++ b/src/policy_cache.hpp @@ -78,22 +78,9 @@ public: insert(std::string const &key_, std::string const &val_) { - uint64_t hash; - const char *ptr; - STRPOOL_U64 token; - - hash = wyhash(key_.c_str(),key_.size(),0xdeadbeef,_wyp); - token = strpool_inject(&_strpool,val_.c_str(),val_.size()); - ptr = strpool_cstr(&_strpool,token); - _cache.insert_or_assign(hash,ptr); - - fmt::print("insert {}={} token={} ptr={}\n", - key_, - val_, - token, - ptr); - - return ptr; + return insert(key_.c_str(), + key_.size(), + val_); } const