Move .merge() from SegmentStatisticUpdater to Statistics.

This is a functional change as maxSpeed is now determined by Segment (rather than the joined Segment).
This commit is contained in:
Dennis Guse
2025-11-20 22:55:46 +01:00
parent 94a0b57362
commit 1ef7a6ecc4
6 changed files with 146 additions and 206 deletions
@@ -94,7 +94,7 @@ public class TrackStatisticsUpdater {
* Compute TrackStatistics.
*/
public Statistics getTrackStatistics() {
return currentSegment.aggregate(statisticsWithoutCurrentSegment);
return currentSegment.merge(statisticsWithoutCurrentSegment);
}
public boolean isIdle() {
@@ -200,7 +200,7 @@ public class TrackStatisticsUpdater {
private void reset(TrackPoint trackPoint) {
if (currentSegment.isInitialized()) {
statisticsWithoutCurrentSegment = currentSegment.aggregate(statisticsWithoutCurrentSegment);
statisticsWithoutCurrentSegment = currentSegment.merge(statisticsWithoutCurrentSegment);
}
currentSegment.reset(trackPoint.getTime());