Skip to content

Commit

Permalink
Pad 0 to bins if l >= StrainSolverData.Count, instead of breaking the…
Browse files Browse the repository at this point in the history
… loop
  • Loading branch information
WilliamQiufeng committed Aug 18, 2024
1 parent 31f2847 commit 203bb4f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,10 @@ private float CalculateOverallDifficulty()
while (r < StrainSolverData.Count - 1 && StrainSolverData[r + 1].StartTime < i + binSize)
r++;
if (l >= StrainSolverData.Count)
break;
{
bins.Add(0);
continue;
}

var valuesInBin = StrainSolverData.GetRange(l, r - l + 1);
var averageRating = valuesInBin.Count > 0 ? valuesInBin.Average(s => s.TotalStrainValue) : 0;
Expand Down

0 comments on commit 203bb4f

Please sign in to comment.