From d1bfba16aeaf692676a70c615e5654df2f410981 Mon Sep 17 00:00:00 2001 From: Jussi Maki Date: Thu, 13 Feb 2025 11:07:03 +0100 Subject: [PATCH] watchset: Do not use exp/maps Signed-off-by: Jussi Maki --- watchset.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/watchset.go b/watchset.go index 34ea071..c4be511 100644 --- a/watchset.go +++ b/watchset.go @@ -5,10 +5,9 @@ package statedb import ( "context" + "maps" "slices" "sync" - - "golang.org/x/exp/maps" ) const watchSetChunkSize = 16 @@ -79,7 +78,7 @@ func (ws *WatchSet) Wait(ctx context.Context) (<-chan struct{}, error) { // Collect the channels into a slice. The slice length is rounded to a full // chunk size. - chans := maps.Keys(ws.chans) + chans := slices.Collect(maps.Keys(ws.chans)) chunkSize := 16 roundedSize := len(chans) + (chunkSize - len(chans)%chunkSize) chans = slices.Grow(chans, roundedSize)[:roundedSize]