summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDane Springmeyer <dane@mapbox.com>2020-03-15 10:51:19 -0700
committerDane Springmeyer <dane@mapbox.com>2020-03-15 10:51:19 -0700
commit9204e4412fb511d58d6506f0921cadced07e6d98 (patch)
tree25608af1f8dfa334328a02f51ecca90e9a8779c9
parent7d77a55fe05266ead14f20d49d9a19a5709d6a8e (diff)
downloadqtlocation-mapboxgl-upstream/springmeyer-fix-unused-var.tar.gz
start using tname variableupstream/springmeyer-fix-unused-var
-rw-r--r--src/mbgl/style/conversion/source.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mbgl/style/conversion/source.cpp b/src/mbgl/style/conversion/source.cpp
index b4a3d74720..cf42b40489 100644
--- a/src/mbgl/style/conversion/source.cpp
+++ b/src/mbgl/style/conversion/source.cpp
@@ -196,16 +196,16 @@ optional<std::unique_ptr<Source>> Converter<std::unique_ptr<Source>>::operator()
error.message = "source type must be a string";
return nullopt;
}
- const std::string tname = *type;
- if (*type == "raster") {
+ const std::string& tname = type.value();
+ if (tname == "raster") {
return convertRasterSource(id, value, error);
- } else if (*type == "raster-dem") {
+ } else if (tname == "raster-dem") {
return convertRasterDEMSource(id, value, error);
- } else if (*type == "vector") {
+ } else if (tname == "vector") {
return convertVectorSource(id, value, error);
- } else if (*type == "geojson") {
+ } else if (tname == "geojson") {
return convertGeoJSONSource(id, value, error);
- } else if (*type == "image") {
+ } else if (tname == "image") {
return convertImageSource(id, value, error);
} else {
error.message = "invalid source type";