mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-06 19:43:06 +02:00
Simplify construction of TrackStatisticsUpdater.
This commit is contained in:
@@ -98,11 +98,15 @@ public class SegmentStatisticUpdater {
|
||||
avgPower = statistics.avgPower();
|
||||
}
|
||||
|
||||
public Statistics aggregate(Statistics statistics) {
|
||||
SegmentStatisticUpdater intermediate = new SegmentStatisticUpdater(statistics);
|
||||
intermediate.merge(this);
|
||||
return intermediate.getStatistics();
|
||||
}
|
||||
|
||||
/**
|
||||
* Combines these statistics with those from another object.
|
||||
* This assumes that the time periods covered by each do not intersect.
|
||||
*
|
||||
* @param other another statistics data object
|
||||
*/
|
||||
//TODO Should be refactored to append only [mainly due to isIdle]
|
||||
public void merge(SegmentStatisticUpdater other) {
|
||||
|
||||
Reference in New Issue
Block a user