redundant if ...; err != nil check, just return error instead.
331 return sortedIndices[i] < sortedIndices[j]
332 })
333
334 if err := committeeCache.AddCommitteeShuffledList(ctx, &cache.Committees{335 ShuffledIndices: shuffledIndices,
336 CommitteeCount: uint64(params.BeaconConfig().SlotsPerEpoch.Mul(count)),
337 Seed: seed,
Description
Some simple error checking patterns can be reduced to just a single return
statement returning a variable of type Error
.
Bad practice
if err != nil {
return err
}
return nil
Recommended
return err