From 0500923d4299de04020a28b2b22018e42b37c3d9 Mon Sep 17 00:00:00 2001 From: qianbin Date: Sat, 30 Apr 2022 21:23:34 +0800 Subject: [PATCH] fix: bucket.Set incorrectly set delete flag --- bucket.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bucket.go b/bucket.go index 61e117c..8594e3d 100644 --- a/bucket.go +++ b/bucket.go @@ -33,8 +33,9 @@ func (b *bucket) Set(key []byte, keyHash uint64, val []byte) (ok bool) { if ent.Match(key) && ent.UpdateValue(val) { ent.AddFlag(recentlyUsedFlag) ok = true + } else { + ent.AddFlag(deletedFlag) } - ent.AddFlag(deletedFlag) } if !ok { newEnt, offset := b.allocEntry(entrySize)