Skip to content

Commit cf8eb73

Browse files
JensRantiljehiah
authored andcommitted
refactor: don't copy a sync.Mutex
Strictly not needed as NewEpsilonGreedy(...) also instantiates the lock and it hasn't been used yet. However, my linter complains that this is done.
1 parent 5d3b4dc commit cf8eb73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

epsilon_greedy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func (r *epsilonHostPoolResponse) Mark(err error) {
2020
}
2121

2222
type epsilonGreedyHostPool struct {
23-
standardHostPool // TODO - would be nifty if we could embed HostPool and Locker interfaces
23+
*standardHostPool // TODO - would be nifty if we could embed HostPool and Locker interfaces
2424
epsilon float32 // this is our exploration factor
2525
decayDuration time.Duration
2626
EpsilonValueCalculator // embed the epsilonValueCalculator
@@ -49,7 +49,7 @@ func NewEpsilonGreedy(hosts []string, decayDuration time.Duration, calc EpsilonV
4949
}
5050
stdHP := New(hosts).(*standardHostPool)
5151
p := &epsilonGreedyHostPool{
52-
standardHostPool: *stdHP,
52+
standardHostPool: stdHP,
5353
epsilon: float32(initialEpsilon),
5454
decayDuration: decayDuration,
5555
EpsilonValueCalculator: calc,

0 commit comments

Comments
 (0)