Replace recursion with loop
This commit is contained in:
parent
db9547ee50
commit
74c7607b3c
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue