Add new containsLocation() that takes latitude and longitude instead LatLng#331
Conversation
…of LatLng In our project, we use different data structure to represent coordinates rather than LatLng. As a result, in order to utilize `containsLocation()`, we have to convert into LatLng which causes an allocation. So if we call it inside a loop through a list of coordinates, that will cause a lot more allocations.
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
|
I signed it! |
|
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
|
I signed it! |
|
CLAs look good, thanks! |
|
+1 for this change, although we'll need to run unit tests manually - there seems to be an issue with recent API Level 24 emulator so Travis builds are hanging (for other projects too - see travis-ci/travis-ci#6122 (comment)). |
|
Thanks @thuytrinh! |
In our project, we use different data structure to represent coordinates rather than
LatLng. As a result, in order to utilizecontainsLocation(), we have to convert intoLatLngwhich causes an allocation. So if we call it inside a loop through a list of coordinates, that will cause a lot more allocations.For example:
So it'd be better if we don't allocate
LatLngs: