summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mbgl/sprite/sprite_loader.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mbgl/sprite/sprite_loader.cpp b/src/mbgl/sprite/sprite_loader.cpp
index 56f7abd50b..6051de7ef4 100644
--- a/src/mbgl/sprite/sprite_loader.cpp
+++ b/src/mbgl/sprite/sprite_loader.cpp
@@ -58,9 +58,9 @@ void SpriteLoader::load(const std::string& url, FileSource& fileSource) {
} else if (res.noContent) {
loader->json = std::make_shared<std::string>();
emitSpriteLoadedIfComplete();
- } else {
+ } else if (loader->json != res.data) { // They can be equal, see OnlineFileRequest::completed().
// Only trigger a sprite loaded event we got new data.
- loader->json = res.data;
+ loader->json = std::move(res.data);
emitSpriteLoadedIfComplete();
}
});
@@ -73,8 +73,8 @@ void SpriteLoader::load(const std::string& url, FileSource& fileSource) {
} else if (res.noContent) {
loader->image = std::make_shared<std::string>();
emitSpriteLoadedIfComplete();
- } else {
- loader->image = res.data;
+ } else if (loader->image != res.data) { // They can be equal - see OnlineFileRequest::completed().
+ loader->image = std::move(res.data);
emitSpriteLoadedIfComplete();
}
});