summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDane Springmeyer <dane@mapbox.com>2016-08-25 11:05:03 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-08-25 11:05:03 -0700
commitbb34b5302c1571c530818dd8b4e98f7e49178744 (patch)
tree3619ac5d197ab0c9c76c024fb8a26a5351a86770
parent01b0b0bf0b5454e8c6e5e41721e1717d886a7a92 (diff)
downloadqtlocation-mapboxgl-bb34b5302c1571c530818dd8b4e98f7e49178744.tar.gz
upgrade to protozer 1.4.0 (#6158)
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/mbgl/tile/vector_tile.cpp21
2 files changed, 11 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 34217e4b57..f8c882b7ab 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,7 +27,7 @@ mason_use(geojsonvt VERSION 6.1.3 HEADER_ONLY)
mason_use(supercluster VERSION 0.2.0 HEADER_ONLY)
mason_use(kdbush VERSION 0.1.1 HEADER_ONLY)
mason_use(earcut VERSION 0.11 HEADER_ONLY)
-mason_use(protozero VERSION 1.3.0 HEADER_ONLY)
+mason_use(protozero VERSION 1.4.0 HEADER_ONLY)
mason_use(pixelmatch VERSION 0.9.0 HEADER_ONLY)
mason_use(geojson VERSION 0.1.4${MASON_CXXABI_SUFFIX})
diff --git a/src/mbgl/tile/vector_tile.cpp b/src/mbgl/tile/vector_tile.cpp
index 6a3c51c05d..1ba30d8695 100644
--- a/src/mbgl/tile/vector_tile.cpp
+++ b/src/mbgl/tile/vector_tile.cpp
@@ -14,8 +14,7 @@ namespace mbgl {
class VectorTileLayer;
-using pbf_iter_type = protozero::pbf_reader::const_uint32_iterator;
-using packed_iter_type = std::pair<pbf_iter_type,pbf_iter_type>;
+using packed_iter_type = protozero::iterator_range<protozero::pbf_reader::const_uint32_iterator>;
class VectorTileFeature : public GeometryTileFeature {
public:
@@ -144,8 +143,8 @@ optional<Value> VectorTileFeature::getValue(const std::string& key) const {
return optional<Value>();
}
- auto start_itr = tags_iter.first;
- const auto & end_itr = tags_iter.second;
+ auto start_itr = tags_iter.begin();
+ const auto & end_itr = tags_iter.end();
while (start_itr != end_itr) {
uint32_t tag_key = static_cast<uint32_t>(*start_itr++);
@@ -172,8 +171,8 @@ optional<Value> VectorTileFeature::getValue(const std::string& key) const {
std::unordered_map<std::string,Value> VectorTileFeature::getProperties() const {
std::unordered_map<std::string,Value> properties;
- auto start_itr = tags_iter.first;
- const auto & end_itr = tags_iter.second;
+ auto start_itr = tags_iter.begin();
+ const auto & end_itr = tags_iter.end();
while (start_itr != end_itr) {
uint32_t tag_key = static_cast<uint32_t>(*start_itr++);
if (start_itr == end_itr) {
@@ -201,10 +200,10 @@ GeometryCollection VectorTileFeature::getGeometries() const {
lines.emplace_back();
GeometryCoordinates* line = &lines.back();
- auto g_itr = geometry_iter;
- while (g_itr.first != g_itr.second) {
+ auto g_itr = geometry_iter.begin();
+ while (g_itr != geometry_iter.end()) {
if (length == 0) {
- uint32_t cmd_length = static_cast<uint32_t>(*g_itr.first++);
+ uint32_t cmd_length = static_cast<uint32_t>(*g_itr++);
cmd = cmd_length & 0x7;
length = cmd_length >> 3;
}
@@ -212,8 +211,8 @@ GeometryCollection VectorTileFeature::getGeometries() const {
--length;
if (cmd == 1 || cmd == 2) {
- x += protozero::decode_zigzag32(static_cast<uint32_t>(*g_itr.first++));
- y += protozero::decode_zigzag32(static_cast<uint32_t>(*g_itr.first++));
+ x += protozero::decode_zigzag32(static_cast<uint32_t>(*g_itr++));
+ y += protozero::decode_zigzag32(static_cast<uint32_t>(*g_itr++));
if (cmd == 1 && !line->empty()) { // moveTo
lines.emplace_back();