mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Add ifPresent check at optional
This commit is contained in:
parent
55c663ad47
commit
832bc83e93
@ -34,6 +34,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@ -223,7 +224,9 @@ public class P2PMarketStats extends P2PSeedNodeSnapshotBase {
|
||||
|
||||
// do version statistics
|
||||
report.clear();
|
||||
versionBucketsPerHost.values().stream().findAny().get().values().forEach((version, numberOfOccurrences) -> report.put(version, String.valueOf(numberOfOccurrences.value())));
|
||||
Optional<Statistics<Aggregator>> optionalStatistics = versionBucketsPerHost.values().stream().findAny();
|
||||
optionalStatistics.ifPresent(aggregatorStatistics -> aggregatorStatistics.values()
|
||||
.forEach((version, numberOfOccurrences) -> report.put(version, String.valueOf(numberOfOccurrences.value()))));
|
||||
reporter.report(report, "versions");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user