summaryrefslogtreecommitdiff
path: root/include/mbgl/style/function/exponential_stops.hpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-05-19 11:12:05 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-05-19 11:48:45 -0700
commit1f921299b0fc43c04cf0d16138d642a5d4e70930 (patch)
tree505a7ba89e4d8fc54d2bacd7291e86e6134234f1 /include/mbgl/style/function/exponential_stops.hpp
parentbdff99c853431b89b56ac9a71dc73a65bc5515df (diff)
downloadqtlocation-mapboxgl-1f921299b0fc43c04cf0d16138d642a5d4e70930.tar.gz
[core] Make ExponentialStops behavior consistent; add tests
Diffstat (limited to 'include/mbgl/style/function/exponential_stops.hpp')
-rw-r--r--include/mbgl/style/function/exponential_stops.hpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/mbgl/style/function/exponential_stops.hpp b/include/mbgl/style/function/exponential_stops.hpp
index 1c57ec6f5d..b3866c4059 100644
--- a/include/mbgl/style/function/exponential_stops.hpp
+++ b/include/mbgl/style/function/exponential_stops.hpp
@@ -24,8 +24,7 @@ public:
optional<T> evaluate(float z) const {
if (stops.empty()) {
- assert(false);
- return T();
+ return {};
}
auto it = stops.upper_bound(z);
@@ -42,7 +41,7 @@ public:
optional<T> evaluate(const Value& value) const {
optional<float> z = numericValue<float>(value);
if (!z) {
- return T();
+ return {};
}
return evaluate(*z);
}