From 573ad107fac3c6f6ab62d77172769866d7bec4c9 Mon Sep 17 00:00:00 2001 From: Wojciech Malota-Wojcik Date: Fri, 6 Dec 2024 08:17:24 +0100 Subject: [PATCH] Stop walk early if we are on mutable path --- space/space.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/space/space.go b/space/space.go index 06e233c..444cbc3 100644 --- a/space/space.go +++ b/space/space.go @@ -923,7 +923,11 @@ func (s *Space[K, V]) walkPointers( hashBuff []byte, hashKeyFunc func(key *K, buff []byte, level uint8) types.KeyHash, ) error { - if v.nextDataNode != nil && types.Load(v.nextDataNode) != types.FreeAddress { + if v.nextDataNode != nil { + if types.Load(v.nextDataNode) == types.FreeAddress { + return nil + } + v.storeRequest.PointersToStore-- v.level-- v.nextDataNode = nil