From 7b6c99bbc293cbf268b7be7f684577dbf668d895 Mon Sep 17 00:00:00 2001 From: Marc Pervaz Boocha Date: Wed, 26 Feb 2025 15:18:02 +0530 Subject: Added Memorize and UpdateInPlace --- encoding.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'encoding.go') diff --git a/encoding.go b/encoding.go index 1327087..a4af699 100644 --- a/encoding.go +++ b/encoding.go @@ -81,7 +81,7 @@ func (e *encoder) EncodeStore(s *store) error { return err } - for v := s.Evict.EvictNext; v != &s.Evict; v = v.EvictNext { + for v := s.EvictList.EvictNext; v != &s.EvictList; v = v.EvictNext { if err := e.EncodeNode(v); err != nil { return err } @@ -186,7 +186,9 @@ func (d *decoder) DecodeStore(s *store) error { return err } - s.Policy.SetPolicy(EvictionPolicyType(policy)) + if err := s.Policy.SetPolicy(EvictionPolicyType(policy)); err != nil { + return err + } length, err := d.DecodeUint64() if err != nil { @@ -217,7 +219,7 @@ func (d *decoder) DecodeStore(s *store) error { v.HashNext.HashPrev = v v.HashPrev.HashNext = v - v.EvictNext = &s.Evict + v.EvictNext = &s.EvictList v.EvictPrev = v.EvictNext.EvictPrev v.EvictNext.EvictPrev = v v.EvictPrev.EvictNext = v -- cgit v1.2.3-70-g09d2