Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] - avoid adding duplicate points to bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
tobrun committed Sep 11, 2017
1 parent a5bfb4a commit 738f682
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ public LatLngBounds build() {
*/
public Builder includes(List<LatLng> latLngs) {
for (LatLng point : latLngs) {
latLngList.add(point);
include(point);
}
return this;
}
Expand All @@ -462,7 +462,9 @@ public Builder includes(List<LatLng> latLngs) {
* @return this
*/
public Builder include(@NonNull LatLng latLng) {
latLngList.add(latLng);
if (!latLngList.contains(latLng)) {
latLngList.add(latLng);
}
return this;
}
}
Expand Down

0 comments on commit 738f682

Please sign in to comment.