summaryrefslogtreecommitdiff
path: root/src/mbgl/style/conversion/geojson_options.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2018-07-30 15:04:41 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2018-07-30 17:17:38 -0700
commit9a1bb1ad14e18433d4cc8e805af57a6014275561 (patch)
tree60533ceadc7bebe48d655041b9c4dbcf4133c32a /src/mbgl/style/conversion/geojson_options.cpp
parentbf7785618ac5f3bbcba068e61ef6359d70aff92b (diff)
downloadqtlocation-mapboxgl-9a1bb1ad14e18433d4cc8e805af57a6014275561.tar.gz
[core] Tweak conversions to reduce binary size
* return {} → return nullopt * error = { "..." } → error.message = "..."
Diffstat (limited to 'src/mbgl/style/conversion/geojson_options.cpp')
-rw-r--r--src/mbgl/style/conversion/geojson_options.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/mbgl/style/conversion/geojson_options.cpp b/src/mbgl/style/conversion/geojson_options.cpp
index a2c5ed8816..52a5030c34 100644
--- a/src/mbgl/style/conversion/geojson_options.cpp
+++ b/src/mbgl/style/conversion/geojson_options.cpp
@@ -12,8 +12,8 @@ optional<GeoJSONOptions> Converter<GeoJSONOptions>::operator()(const Convertible
if (toNumber(*minzoomValue)) {
options.minzoom = static_cast<uint8_t>(*toNumber(*minzoomValue));
} else {
- error = { "GeoJSON source minzoom value must be a number" };
- return {};
+ error.message = "GeoJSON source minzoom value must be a number";
+ return nullopt;
}
}
@@ -22,8 +22,8 @@ optional<GeoJSONOptions> Converter<GeoJSONOptions>::operator()(const Convertible
if (toNumber(*maxzoomValue)) {
options.maxzoom = static_cast<uint8_t>(*toNumber(*maxzoomValue));
} else {
- error = { "GeoJSON source maxzoom value must be a number" };
- return {};
+ error.message = "GeoJSON source maxzoom value must be a number";
+ return nullopt;
}
}
@@ -32,8 +32,8 @@ optional<GeoJSONOptions> Converter<GeoJSONOptions>::operator()(const Convertible
if (toNumber(*bufferValue)) {
options.buffer = static_cast<uint16_t>(*toNumber(*bufferValue));
} else {
- error = { "GeoJSON source buffer value must be a number" };
- return {};
+ error.message = "GeoJSON source buffer value must be a number";
+ return nullopt;
}
}
@@ -42,8 +42,8 @@ optional<GeoJSONOptions> Converter<GeoJSONOptions>::operator()(const Convertible
if (toNumber(*toleranceValue)) {
options.tolerance = static_cast<double>(*toNumber(*toleranceValue));
} else {
- error = { "GeoJSON source tolerance value must be a number" };
- return {};
+ error.message = "GeoJSON source tolerance value must be a number";
+ return nullopt;
}
}
@@ -52,8 +52,8 @@ optional<GeoJSONOptions> Converter<GeoJSONOptions>::operator()(const Convertible
if (toBool(*clusterValue)) {
options.cluster = *toBool(*clusterValue);
} else {
- error = { "GeoJSON source cluster value must be a boolean" };
- return {};
+ error.message = "GeoJSON source cluster value must be a boolean";
+ return nullopt;
}
}
@@ -62,8 +62,8 @@ optional<GeoJSONOptions> Converter<GeoJSONOptions>::operator()(const Convertible
if (toNumber(*clusterMaxZoomValue)) {
options.clusterMaxZoom = static_cast<uint8_t>(*toNumber(*clusterMaxZoomValue));
} else {
- error = { "GeoJSON source clusterMaxZoom value must be a number" };
- return {};
+ error.message = "GeoJSON source clusterMaxZoom value must be a number";
+ return nullopt;
}
}
@@ -72,8 +72,8 @@ optional<GeoJSONOptions> Converter<GeoJSONOptions>::operator()(const Convertible
if (toNumber(*clusterRadiusValue)) {
options.clusterRadius = static_cast<double>(*toNumber(*clusterRadiusValue));
} else {
- error = { "GeoJSON source clusterRadius value must be a number" };
- return {};
+ error.message = "GeoJSON source clusterRadius value must be a number";
+ return nullopt;
}
}