From e071a07ab7fcfecb7192d24a6bc7e87cc35ad90d Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Fri, 16 Feb 2024 00:08:09 -0600 Subject: [PATCH] policy_cache.hpp --- src/policy_cache.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/policy_cache.hpp b/src/policy_cache.hpp index 3fee4f12..f892907c 100644 --- a/src/policy_cache.hpp +++ b/src/policy_cache.hpp @@ -42,6 +42,8 @@ public: insert(std::string const &key_, std::string &val_) { + if(_cache.size() > _max_size) + _cache.erase(_cache.begin()); _cache.insert({key_,val_}); }