summaryrefslogtreecommitdiff
path: root/src/mbgl/storage/resource.cpp
diff options
context:
space:
mode:
authorRandall Lee <randall.lee@mapbox.com>2018-05-22 14:09:36 -0400
committerGitHub <noreply@github.com>2018-05-22 14:09:36 -0400
commitd858cb783b499a1cc77b48a0faee137ca5e6a423 (patch)
tree5c36c353730e3050d44e472545519c0429723266 /src/mbgl/storage/resource.cpp
parentf93d722458be62d567aa152711a014ef51a90193 (diff)
parent60505b03174b5ec02ae723beafa7683f6ed54a62 (diff)
downloadqtlocation-mapboxgl-upstream/rclee-async-setup.tar.gz
Merge branch 'master' into rclee-async-setupupstream/rclee-async-setup
Diffstat (limited to 'src/mbgl/storage/resource.cpp')
-rw-r--r--src/mbgl/storage/resource.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mbgl/storage/resource.cpp b/src/mbgl/storage/resource.cpp
index 207dd2ee69..ba85f87dea 100644
--- a/src/mbgl/storage/resource.cpp
+++ b/src/mbgl/storage/resource.cpp
@@ -79,13 +79,13 @@ Resource Resource::spriteJSON(const std::string& base, float pixelRatio) {
Resource Resource::glyphs(const std::string& urlTemplate, const FontStack& fontStack, const std::pair<uint16_t, uint16_t>& glyphRange) {
return Resource {
Resource::Kind::Glyphs,
- util::replaceTokens(urlTemplate, [&](const std::string& token) {
+ util::replaceTokens(urlTemplate, [&](const std::string& token) -> optional<std::string> {
if (token == "fontstack") {
return util::percentEncode(fontStackToString(fontStack));
} else if (token == "range") {
return util::toString(glyphRange.first) + "-" + util::toString(glyphRange.second);
} else {
- return std::string();
+ return {};
}
})
};
@@ -104,7 +104,7 @@ Resource Resource::tile(const std::string& urlTemplate,
}
return Resource {
Resource::Kind::Tile,
- util::replaceTokens(urlTemplate, [&](const std::string& token) {
+ util::replaceTokens(urlTemplate, [&](const std::string& token) -> optional<std::string> {
if (token == "z") {
return util::toString(z);
} else if (token == "x") {
@@ -123,7 +123,7 @@ Resource Resource::tile(const std::string& urlTemplate,
} else if (token == "ratio") {
return std::string(pixelRatio > 1.0 ? "@2x" : "");
} else {
- return std::string();
+ return {};
}
}),
Resource::TileData {