Skip to content

Commit 4e56dc9

Browse files
committed
Use slices.Backward()
1 parent b654e0f commit 4e56dc9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pipe/pipeline.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"fmt"
88
"io"
99
"os"
10+
"slices"
1011
"sync/atomic"
1112
)
1213

@@ -523,8 +524,7 @@ func (p *Pipeline) Wait() error {
523524
var earliestFailedStage Stage
524525

525526
finishedEarly := false
526-
for i := len(p.stages) - 1; i >= 0; i-- {
527-
s := p.stages[i]
527+
for _, s := range slices.Backward(p.stages) {
528528
err := s.Wait()
529529

530530
// Handle errors:

0 commit comments

Comments
 (0)