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

avoid adding duplicate points to bounds #9955

Merged
merged 1 commit into from
Sep 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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