We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0be5a41 commit 5209cc3Copy full SHA for 5209cc3
lbclient.go
@@ -112,16 +112,14 @@ func (cc *LBClient) AddClient(c BalancingClient) int {
112
func (cc *LBClient) RemoveClients(rc func(BalancingClient) bool) int {
113
cc.mu.Lock()
114
n := 0
115
- for _, cs := range cc.cs {
+ for idx, cs := range cc.cs {
116
+ cc.cs[idx] = nil
117
if rc(cs.c) {
118
continue
119
}
120
cc.cs[n] = cs
121
n++
122
- for i := n; i < len(cc.cs); i++ {
123
- cc.cs[i] = nil
124
- }
125
cc.cs = cc.cs[:n]
126
127
cc.mu.Unlock()
0 commit comments