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

[core] Fix regression in Bucket::hasData - #6876

Merged
brunoabinader merged 1 commit into
masterfrom
bucket-hasdata
Nov 2, 2016
Merged

brunoabinader merged 1 commit into
masterfrom
bucket-hasdata

Conversation

@brunoabinader

Copy link
Copy Markdown
Contributor

As per @jfirebaugh review in 384f1a1#commitcomment-19656901, commit 384f1a1 introduced a regression in {Circle,Fill,Line,Symbol}Bucket::hasData() in a sense that an empty bucket would never return false.

@brunoabinader brunoabinader added bug Core The cross-platform C++ core, aka mbgl labels Nov 2, 2016
@mention-bot

Copy link
Copy Markdown

@brunoabinader, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jfirebaugh, @kkaefer and @ansis to be potential reviewers.

@kkaefer

kkaefer commented Nov 2, 2016

Copy link
Copy Markdown
Member

Why did you remove the segments.empty() check in the first place?

@brunoabinader

Copy link
Copy Markdown
Contributor Author

Why did you remove the segments.empty() check in the first place?

Rationale is that we frequently update bucket contents - so we can save one less check on each pass by initializing the segments container with one empty segment.

@kkaefer

kkaefer commented Nov 2, 2016

Copy link
Copy Markdown
Member

Okay, but it also feels weird to start out empty buckets with an actual segment in the list.

@brunoabinader

brunoabinader commented Nov 2, 2016 •

Copy link
Copy Markdown
Contributor Author

Okay, but it also feels weird to start out empty buckets with an actual segment in the list.

Right, I can extract that change out of 384f1a1 then. Will keep the utests to make sure of it in the future.

@jfirebaugh jfirebaugh 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.

Thanks!

@brunoabinader
brunoabinader merged commit 549929c into master Nov 2, 2016
@brunoabinader
brunoabinader deleted the bucket-hasdata branch November 2, 2016 16:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Core The cross-platform C++ core, aka mbgl

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants