Skip to content

Commit

Permalink
errgroup: remove redundant len check (#2354)
Browse files Browse the repository at this point in the history
`len(g.children) > 0` is redundant because `range` already skips empty
slice.

Signed-off-by: Eng Zer Jun <[email protected]>
  • Loading branch information
Juneezee authored Apr 24, 2024
1 parent 4e90cd4 commit df7737e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions core/errgroup/errgroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,9 @@ func isNotNil(err error) bool {
return true
}

if len(g.children) > 0 {
for _, child := range g.children {
if isNotNil(child) {
return true
}
for _, child := range g.children {
if isNotNil(child) {
return true
}
}

Expand Down

0 comments on commit df7737e

Please sign in to comment.