From 269575baa94fe40d2e2cc9ef012a2d28a8f82bec Mon Sep 17 00:00:00 2001 From: Peter Hanecak Date: Fri, 3 Nov 2023 19:36:30 +0100 Subject: [PATCH] first sub-class search for agg_stop simplified a little --- src/main/java/org/openmaptiles/layers/Poi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/openmaptiles/layers/Poi.java b/src/main/java/org/openmaptiles/layers/Poi.java index 70e4aa34..c8cbbad6 100644 --- a/src/main/java/org/openmaptiles/layers/Poi.java +++ b/src/main/java/org/openmaptiles/layers/Poi.java @@ -222,7 +222,7 @@ public void finish(String sourceName, FeatureCollector.Factory featureCollectors } try { // find first based on subclass - var firstSubclass = aggStopSet.stream().sorted(BY_SUBCLASS).toArray(Tables.OsmPoiPoint[]::new)[0].subclass(); + var firstSubclass = aggStopSet.stream().min(BY_SUBCLASS).get().subclass(); var topAggStops = aggStopSet.stream().filter(s -> firstSubclass.equals(s.subclass())).toArray(Tables.OsmPoiPoint[]::new); if (topAggStops.length <= 2) {