From fbb2d17f4317c0742dd89988882c3c3995f23580 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Sun, 8 Mar 2015 14:13:46 -0700 Subject: [PATCH] fix iterator comparator --- src/mbgl/map/vector_tile.cpp | 6 +++++- src/mbgl/map/vector_tile.hpp | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mbgl/map/vector_tile.cpp b/src/mbgl/map/vector_tile.cpp index f31dd27aa..d74a5922e 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 a306f524d..fe154bc85 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 getProperties() const { return properties; } virtual GeometryCollection nextGeometry(); + bool operator==(const VectorTileFeature&) const; private: uint64_t id = 0;