Skip to content

Commit

Permalink
fix gocritic copying rule unintentional shadowing
Browse files Browse the repository at this point in the history
  • Loading branch information
k0l11 committed Sep 12, 2023
1 parent 9ee6a3e commit db395e8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions pkg/agg/overview/overview.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,30 @@ func (b *buffer) Add(result stats.Result) {
b.hps.Xs = append(b.hps.Xs, 0)
b.eps.Xs = append(b.eps.Xs, 0)
b.shp.Xs = append(b.shp.Xs, 0)
i := len(b.shp.Xs) - 1
iX := len(b.shp.Xs) - 1

for _, interval := range result.ShieldResults.EffectiveShield["normalized"] {
end := interval.End
if end > result.Duration {
end = result.Duration
}
b.shp.Xs[i] += interval.HP * float64(end-interval.Start)
b.shp.Xs[iX] += interval.HP * float64(end-interval.Start)
}
b.shp.Xs[i] /= float64(result.Duration)
b.shp.Xs[iX] /= float64(result.Duration)

for i := range result.Characters {
b.rps.Xs[i] += float64(len(result.Characters[i].ReactionEvents))
b.rps.Xs[iX] += float64(len(result.Characters[i].ReactionEvents))
for _, h := range result.Characters[i].HealEvents {
b.hps.Xs[i] += h.Heal
b.hps.Xs[iX] += h.Heal
}
for _, e := range result.Characters[i].EnergyEvents {
b.eps.Xs[i] += e.Gained + e.Wasted
b.eps.Xs[iX] += e.Gained + e.Wasted
}
}

b.rps.Xs[i] /= b.duration.Xs[i]
b.hps.Xs[i] /= b.duration.Xs[i]
b.eps.Xs[i] /= b.duration.Xs[i]
b.rps.Xs[iX] /= b.duration.Xs[iX]
b.hps.Xs[iX] /= b.duration.Xs[iX]
b.eps.Xs[iX] /= b.duration.Xs[iX]
}

func (b *buffer) Flush(result *model.SimulationStatistics) {
Expand Down

0 comments on commit db395e8

Please sign in to comment.