Skip to content

Commit cc96340

Browse files
committed
Fix golangci-lint errors
1 parent 98c55e5 commit cc96340

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

go/pkg/router/tc/tc.go

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,7 @@ func (qs *Queues) setToNonempty() {
120120

121121
// WaitUntilNonempty blocks until new messages are ready to be scheduled.
122122
func (qs *Queues) WaitUntilNonempty() {
123-
select {
124-
case <-qs.nonempty:
125-
}
123+
<-qs.nonempty
126124
}
127125

128126
// dequeue reads up to 'batchSize' number of messages from the queue corresponding to the traffic
@@ -132,20 +130,7 @@ func (qs *Queues) dequeue(tc TrafficClass, batchSize int, ms []ipv4.Message) (in
132130
if !ok {
133131
return 0, serrors.New("unknown traffic class")
134132
}
135-
136-
var counter int
137-
L:
138-
for counter = 0; counter < batchSize; counter++ {
139-
select {
140-
case m := <-q.filledPackets:
141-
ms[counter] = m
142-
default:
143-
break L
144-
}
145-
}
146-
147-
q.borrowed = q.borrowed + counter
148-
return counter, nil
133+
return q.dequeue(batchSize, ms), nil
149134
}
150135

151136
// Schedule dequeues messages from the queues and prioritizes them according the the specified

0 commit comments

Comments
 (0)