Distance.ZERO as constant.

This commit is contained in:
Dennis Guse
2025-11-02 08:32:04 +01:00
parent fffeb40200
commit 6e4d46a14d
13 changed files with 30 additions and 28 deletions
@@ -65,7 +65,7 @@ public class AggregatedStatistics {
this.countTracks = tracks.size();
totalMovingTime = tracks.stream().map(t -> t.getStatistics().movingTime()).reduce(Duration.ZERO, Duration::plus);
totalDistance = tracks.stream().map(t -> t.getStatistics().totalDistance()).reduce(Distance.of(0), Distance::plus);
totalDistance = tracks.stream().map(t -> t.getStatistics().totalDistance()).reduce(Distance.ZERO, Distance::plus);
maxSpeed = tracks.stream().map(t -> t.getStatistics().maxSpeed()).max((o1, o2) -> (int) (o1.speed_mps() - o2.speed_mps())).orElse(Speed.ZERO);
avgMovingSpeed = Speed.of(totalDistance, totalMovingTime);
}
@@ -45,7 +45,7 @@ public class SettingsCustomLayoutEditAdapter extends RecyclerView.Adapter<Recycl
Duration.ofMinutes(0),
Duration.ofMinutes(0),
Distance.of(0),
Distance.ZERO,
Speed.ZERO,
null,
@@ -103,7 +103,7 @@ public class IntervalStatisticsUpdater {
//TODO Could be replaced with Statistics?
@Deprecated
private static class Interval {
private Distance distance = Distance.of(0);
private Distance distance = Distance.ZERO;
private Duration time = Duration.ofSeconds(0);
private Float gain_m;
private Float loss_m;