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

Avoid creating InfoWindow iterator if no InfoWindows are shown #9477

Merged
merged 1 commit into from
Jul 20, 2017

Conversation

tobrun
Copy link
Member

@tobrun tobrun commented Jul 11, 2017

Every time we receive a region change event, we are synchronizing Android SDK view components on top of the map. With profiling of gestures in #9476, I'm noticing we are allocating iterators for InfoWindows while no InfoWindows are shown. Checking for an empty avoids creating unneeded allocations.

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Jul 11, 2017
@tobrun tobrun added this to the android-v5.2.0 milestone Jul 11, 2017
@tobrun tobrun self-assigned this Jul 11, 2017
@@ -56,10 +58,6 @@ boolean isAllowConcurrentMultipleOpenInfoWindows() {
return allowConcurrentMultipleInfoWindows;
}

List<InfoWindow> getInfoWindows() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to remove this getter?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was unused & not part of our public api

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tobrun 👍

@tobrun tobrun force-pushed the tvn-avoid-iterating branch from c2bd866 to 41f7bf1 Compare July 14, 2017 08:29
Copy link
Contributor

@Guardiola31337 Guardiola31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor detail.

@@ -31,12 +32,13 @@
private MapboxMap.OnInfoWindowCloseListener onInfoWindowCloseListener;

InfoWindowManager() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to keep this empty constructor.

@tobrun tobrun force-pushed the tvn-avoid-iterating branch 2 times, most recently from 790b7ae to d92f726 Compare July 18, 2017 12:42
@tobrun tobrun force-pushed the tvn-avoid-iterating branch from d92f726 to dabb168 Compare July 18, 2017 13:38
@tobrun tobrun merged commit f19c36a into master Jul 20, 2017
@tobrun tobrun deleted the tvn-avoid-iterating branch July 20, 2017 08:18
@Guardiola31337 Guardiola31337 mentioned this pull request Oct 6, 2017
20 tasks
@Guardiola31337 Guardiola31337 mentioned this pull request Oct 19, 2017
20 tasks
@Guardiola31337 Guardiola31337 mentioned this pull request Oct 26, 2017
20 tasks
@tobrun tobrun mentioned this pull request Nov 3, 2017
21 tasks
This was referenced Nov 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants