summaryrefslogtreecommitdiff
path: root/src/mbgl
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-01-13 16:54:27 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-01-14 13:46:03 -0800
commit1c887ff728d85d75f77556452386a5ef70eee94f (patch)
tree565889d0207c8196ce37ab723f4af4edea1faf1a /src/mbgl
parent2aafdbc1b84192d9a51ff7f5f9d9830e0951bb2a (diff)
downloadqtlocation-mapboxgl-1c887ff728d85d75f77556452386a5ef70eee94f.tar.gz
[core] Use notModified rather than storing the previous response body
Diffstat (limited to 'src/mbgl')
-rw-r--r--src/mbgl/map/vector_tile.cpp5
-rw-r--r--src/mbgl/map/vector_tile.hpp1
2 files changed, 2 insertions, 4 deletions
diff --git a/src/mbgl/map/vector_tile.cpp b/src/mbgl/map/vector_tile.cpp
index c53559d9cf..343efe4314 100644
--- a/src/mbgl/map/vector_tile.cpp
+++ b/src/mbgl/map/vector_tile.cpp
@@ -185,7 +185,7 @@ VectorTileMonitor::VectorTileMonitor(const TileID& tileID_, const std::string& u
std::unique_ptr<FileRequest> VectorTileMonitor::monitorTile(const GeometryTileMonitor::Callback& callback) {
const std::string url = util::templateTileURL(urlTemplate, tileID);
return util::ThreadContext::getFileSource()->request({ Resource::Kind::Tile, url }, [callback, this](Response res) {
- if (res.data && data == res.data) {
+ if (res.notModified) {
// We got the same data again. Abort early.
return;
}
@@ -200,8 +200,7 @@ std::unique_ptr<FileRequest> VectorTileMonitor::monitorTile(const GeometryTileMo
}
}
- data = res.data;
- callback(nullptr, std::make_unique<VectorTile>(data), res.modified, res.expires);
+ callback(nullptr, std::make_unique<VectorTile>(res.data), res.modified, res.expires);
});
}
diff --git a/src/mbgl/map/vector_tile.hpp b/src/mbgl/map/vector_tile.hpp
index fb2007aa44..1b836b84bc 100644
--- a/src/mbgl/map/vector_tile.hpp
+++ b/src/mbgl/map/vector_tile.hpp
@@ -68,7 +68,6 @@ public:
private:
TileID tileID;
std::string urlTemplate;
- std::shared_ptr<const std::string> data;
};
} // namespace mbgl