From 1f921299b0fc43c04cf0d16138d642a5d4e70930 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 19 May 2017 11:12:05 -0700 Subject: [core] Make ExponentialStops behavior consistent; add tests --- include/mbgl/style/function/exponential_stops.hpp | 5 ++--- include/mbgl/style/function/interval_stops.hpp | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'include/mbgl') 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 evaluate(float z) const { if (stops.empty()) { - assert(false); - return T(); + return {}; } auto it = stops.upper_bound(z); @@ -42,7 +41,7 @@ public: optional evaluate(const Value& value) const { optional z = numericValue(value); if (!z) { - return T(); + return {}; } return evaluate(*z); } diff --git a/include/mbgl/style/function/interval_stops.hpp b/include/mbgl/style/function/interval_stops.hpp index a482a6081c..45e2dc6f2e 100644 --- a/include/mbgl/style/function/interval_stops.hpp +++ b/include/mbgl/style/function/interval_stops.hpp @@ -20,7 +20,6 @@ public: optional evaluate(float z) const { if (stops.empty()) { - assert(false); return {}; } -- cgit v1.2.1