Skip to content

Commit

Permalink
perf: Use LinkedHashSet instead of List in StaticCluster (#918)
Browse files Browse the repository at this point in the history
Closes #917
  • Loading branch information
YegorKozlov committed Jul 8, 2021
1 parent 862db8c commit 1b6e817
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -20,7 +20,7 @@
import com.google.maps.android.clustering.Cluster;
import com.google.maps.android.clustering.ClusterItem;

import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.Collection;
import java.util.List;

Expand All @@ -29,7 +29,7 @@
*/
public class StaticCluster<T extends ClusterItem> implements Cluster<T> {
private final LatLng mCenter;
private final List<T> mItems = new ArrayList<T>();
private final Collection<T> mItems = new LinkedHashSet<>();

public StaticCluster(LatLng center) {
mCenter = center;
Expand Down

0 comments on commit 1b6e817

Please sign in to comment.