summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin R. Miller <incanus@codesorcery.net>2015-03-08 14:13:46 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-03-09 11:57:34 -0700
commitfbb2d17f4317c0742dd89988882c3c3995f23580 (patch)
treed38a37c107d84a027983410f42a8c952e07e44bb /src
parenta6b6a8d67ea6a2ab324e639a32473137da739870 (diff)
downloadqtlocation-mapboxgl-fbb2d17f4317c0742dd89988882c3c3995f23580.tar.gz
fix iterator comparator
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/map/vector_tile.cpp6
-rw-r--r--src/mbgl/map/vector_tile.hpp1
2 files changed, 6 insertions, 1 deletions
diff --git a/src/mbgl/map/vector_tile.cpp b/src/mbgl/map/vector_tile.cpp
index f31dd27aa2..d74a5922e1 100644
--- a/src/mbgl/map/vector_tile.cpp
+++ b/src/mbgl/map/vector_tile.cpp
@@ -97,6 +97,10 @@ GeometryCollection VectorTileFeature::nextGeometry() {
return std::move(result);
}
+bool VectorTileFeature::operator==(const VectorTileFeature& other) const {
+ return (geometry_pbf == other.geometry_pbf);
+}
+
VectorTile::VectorTile(pbf tile_pbf) {
while (tile_pbf.next()) {
if (tile_pbf.tag == 3) { // layer
@@ -234,7 +238,7 @@ void FilteredVectorTileLayer::iterator::operator++() {
}
bool FilteredVectorTileLayer::iterator::operator!=(const iterator& other) const {
- return !(feature_pbf.data == other.feature_pbf.data && feature_pbf.end == other.feature_pbf.end && valid == other.valid);
+ return !(feature == other.feature);
}
const VectorTileFeature& FilteredVectorTileLayer::iterator::operator*() const {
diff --git a/src/mbgl/map/vector_tile.hpp b/src/mbgl/map/vector_tile.hpp
index a306f524dc..fe154bc85c 100644
--- a/src/mbgl/map/vector_tile.hpp
+++ b/src/mbgl/map/vector_tile.hpp
@@ -17,6 +17,7 @@ public:
virtual inline GeometryFeatureType getType() const { return type; }
virtual inline std::map<std::string, Value> getProperties() const { return properties; }
virtual GeometryCollection nextGeometry();
+ bool operator==(const VectorTileFeature&) const;
private:
uint64_t id = 0;