Skip to content

Commit

Permalink
rename "ind" to "i"
Browse files Browse the repository at this point in the history
  • Loading branch information
utku-caglayan committed Dec 24, 2021
1 parent 3491021 commit c1efb0c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions internal/invocation/stripe_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ func newStripeExecutorWithConf(queueCount, queueSize uint32) stripeExecutor {
taskQueues: make([]chan func(), queueCount),
queueCount: queueCount,
}
for ind := range se.taskQueues {
se.taskQueues[ind] = make(chan func(), queueSize)
for i := range se.taskQueues {
se.taskQueues[i] = make(chan func(), queueSize)
}
se.quit = make(chan struct{})
se.wg = &sync.WaitGroup{}
Expand All @@ -49,9 +49,10 @@ func newStripeExecutorWithConf(queueCount, queueSize uint32) stripeExecutor {
// start fires up the workers for each queue.
func (se stripeExecutor) start() {
se.wg.Add(int(se.queueCount))
for ind := range se.taskQueues {
ind := ind
go se.execFn(se.taskQueues[ind], se.quit, se.wg)
for i := range se.taskQueues {
// copy to temp var
index := i
go se.execFn(se.taskQueues[index], se.quit, se.wg)
}
}

Expand Down

0 comments on commit c1efb0c

Please sign in to comment.