Skip to content
This repository was archived by the owner on Jun 4, 2026. It is now read-only.

[WIP] Use mapbox::geometry - #39

Merged
springmeyer merged 51 commits into
masterfrom
geometry
May 4, 2016
Merged

springmeyer merged 51 commits into
masterfrom
geometry

Conversation

@springmeyer

@springmeyer springmeyer commented May 3, 2016 •

Copy link
Copy Markdown

artemp and others added 28 commits April 13, 2016 09:55
* Avoid converting raw character buffers to std::string prior comparing, use native `rapidjson::GenericValue<>` vs string literal operator==().
* Don't rely on compiler optimising loops like `for (size_t i = 0; i < cont.siez() ; ++i)` - prefer
```c++
size_t size = cont.size();
for (size_t i = 0; i < size ; ++i) {}
```
* pass ProjectedGeometry by const reference: `create(Tags tags, ProjectedFeatureType type, ProjectedGeometry const& geometry);`

(ref http://rapidjson.org/md_doc_tutorial.html#ValueDocument)
…t in intialiser list: just stanfard copy pattern passing by const reference
Comment thread .gitmodules Outdated
[submodule ".mason"]
path = .mason
url = https://github.com/mapbox/mason.git
[submodule "deps/geometry"]

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.

Revert the submodule addition.

Comment thread src/tile.cpp
simplifiedRing.points.push_back(p);
++tile.numSimplified;
if (!p_rings.empty()) {
tile.features.emplace_back(std::move(p_rings), type, feature.tags);

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.

I saw @artemp dropping std::move calls everywhere through the codebase, are they needed here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@mourner std::move should be avoided when it will prevent RVO. In this case I think std::move is needed to trigger a move rather than a copy. However even if this is not needed for a given compiler I don't seen any harm, but would be happy to be wrong if @artemp sees this differently.

@springmeyer

Copy link
Copy Markdown
Author

Okay, I think this is ready. My plan is to:

Reflections:

  • This pull mixes the geometry switch, optimizations, code correctness, and more changes
  • While is not ideal... the work to separate them I think is not worth it and squashing commits would loose some valuable history in this seemingly small change that took a variety of effort.

@springmeyer
springmeyer merged commit b5ef629 into master May 4, 2016
@springmeyer
springmeyer deleted the geometry branch May 4, 2016 19:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants