Skip to content

Commit

Permalink
refactor: using maps.Clone
Browse files Browse the repository at this point in the history
  • Loading branch information
cuiweixie committed Oct 8, 2024
1 parent cfb211f commit d989410
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions das/reader_aggregator_strategies.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package das

import (
"errors"
"maps"
"math/rand"
"sort"
"sync"
Expand Down Expand Up @@ -33,10 +34,7 @@ func (s *abstractAggregatorStrategy) update(readers []daprovider.DASReader, stat
s.readers = make([]daprovider.DASReader, len(readers))
copy(s.readers, readers)

s.stats = make(map[daprovider.DASReader]readerStats)
for k, v := range stats {
s.stats[k] = v
}
s.stats = maps.Clone(stats)
}

// Exponentially growing Explore Exploit Strategy
Expand Down

0 comments on commit d989410

Please sign in to comment.