Skip to content

Commit 1199c1b

Browse files
author
Andrii Bondarchuk
committed
Change sum type from double to short in TssCalculator
Updated the sum variable in TssCalculator from double to short, as power values are within a range suitable for short. This improves efficiency and better matches the expected data range.
1 parent 085877c commit 1199c1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/FitSyncHub.Common/TssCalculator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private static double CalculateNormalizedPower(List<ushort> powerValues)
5555

5656
List<double> rollingAverages = [];
5757
// short should be enough, power values are usually within 0-2000 range
58-
double sum = 0;
58+
short sum = 0;
5959

6060
// Initial window
6161
for (var i = 0; i < WindowSize; i++)

0 commit comments

Comments
 (0)