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

Avoid creating InfoWindow iterator if no InfoWindows are shown - #9477

Merged
tobrun merged 1 commit into
masterfrom
tvn-avoid-iterating
Jul 20, 2017
Merged

tobrun merged 1 commit into
masterfrom
tvn-avoid-iterating

Conversation

@tobrun

@tobrun tobrun commented Jul 11, 2017 •

Copy link
Copy Markdown
Member

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
return allowConcurrentMultipleInfoWindows;
}

List<InfoWindow> getInfoWindows() {

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

@Guardiola31337 Guardiola31337 left a comment

Copy link
Copy Markdown
Contributor

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 @@ class InfoWindowManager {
private MapboxMap.OnInfoWindowCloseListener onInfoWindowCloseListener;

InfoWindowManager() {

Copy link
Copy Markdown
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
15 of 20 tasks
@Guardiola31337 Guardiola31337 mentioned this pull request Oct 19, 2017
16 of 20 tasks
@Guardiola31337 Guardiola31337 mentioned this pull request Oct 26, 2017
15 of 20 tasks
@tobrun tobrun mentioned this pull request Nov 3, 2017
17 of 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