Skip to content

Commit

Permalink
watchset: Do not use exp/maps
Browse files Browse the repository at this point in the history
Signed-off-by: Jussi Maki <[email protected]>
  • Loading branch information
joamaki committed Feb 13, 2025
1 parent b4a4505 commit d1bfba1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions watchset.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ package statedb

import (
"context"
"maps"
"slices"
"sync"

"golang.org/x/exp/maps"
)

const watchSetChunkSize = 16
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit d1bfba1

Please sign in to comment.