From 74c7607b3c3ec9cb8e90796407ad003d6ed21dfb Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Tue, 28 Nov 2017 11:15:47 +0200 Subject: [PATCH] Replace recursion with loop --- OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java index fdb2b315ef..f99e0bd8f5 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java @@ -458,7 +458,8 @@ public class MapMarkersDbHelper { } private void buildLinkedList(HashMap markers, List res) { - if (!markers.isEmpty()) { + int markersCount = markers.size(); + for (int i = 0; i < markersCount; i++) { int count = 1; for (MapMarker marker : markers.values()) { if (!markers.keySet().contains(marker.nextKey) || count == markers.size()) { @@ -468,7 +469,6 @@ public class MapMarkersDbHelper { } count++; } - buildLinkedList(markers, res); } }