From 255bd6877f348631dc5fc57d5f3fdaf3b2e97307 Mon Sep 17 00:00:00 2001 From: Artur Melanchyk <13834276+arturmelanchyk@users.noreply.github.com> Date: Tue, 9 Sep 2025 12:03:59 +0200 Subject: [PATCH] internal/freelist: make pcache a map of struct{} Signed-off-by: Artur Melanchyk <13834276+arturmelanchyk@users.noreply.github.com> --- internal/freelist/shared.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/freelist/shared.go b/internal/freelist/shared.go index f2d113008..f30a69f10 100644 --- a/internal/freelist/shared.go +++ b/internal/freelist/shared.go @@ -220,10 +220,10 @@ func (t *shared) Reload(p *common.Page) { func (t *shared) NoSyncReload(pgIds common.Pgids) { // Build a cache of only pending pages. - pcache := make(map[common.Pgid]bool) + pcache := make(map[common.Pgid]struct{}) for _, txp := range t.pending { for _, pendingID := range txp.ids { - pcache[pendingID] = true + pcache[pendingID] = struct{}{} } } @@ -231,7 +231,7 @@ func (t *shared) NoSyncReload(pgIds common.Pgids) { // with any pages not in the pending lists. a := []common.Pgid{} for _, id := range pgIds { - if !pcache[id] { + if _, ok := pcache[id]; !ok { a = append(a, id) } }