utils: *BUG* Solving a bug with Lfu policy, which effectively made the policy unusable
Update and Lookup events that supposed to update position of CS entry in
the policy container were not implemented correctly.
diff --git a/utils/trie/lfu-policy.h b/utils/trie/lfu-policy.h
index e453813..7720a12 100644
--- a/utils/trie/lfu-policy.h
+++ b/utils/trie/lfu-policy.h
@@ -92,7 +92,7 @@
inline void
update (typename parent_trie::iterator item)
{
- policy_container::erase (*item);
+ policy_container::erase (policy_container::s_iterator_to (*item));
get_order (item) += 1;
policy_container::insert (*item);
}
@@ -115,7 +115,7 @@
inline void
lookup (typename parent_trie::iterator item)
{
- policy_container::erase (*item);
+ policy_container::erase (policy_container::s_iterator_to (*item));
get_order (item) += 1;
policy_container::insert (*item);
}