Replace recursion with loop

This commit is contained in:
Alexander Sytnyk 2017-11-28 11:15:47 +02:00
parent db9547ee50
commit 74c7607b3c

View file

@ -458,7 +458,8 @@ public class MapMarkersDbHelper {
}
private void buildLinkedList(HashMap<String, MapMarker> markers, List<MapMarker> 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);
}
}