From a6727921fc1608d341c086cd70341e6df5e79a2b Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 29 Jun 2018 12:52:08 -0700 Subject: [core] Convert legacy functions directly to expressions --- src/mbgl/style/function/categorical_stops.cpp | 41 --------------------------- 1 file changed, 41 deletions(-) delete mode 100644 src/mbgl/style/function/categorical_stops.cpp (limited to 'src/mbgl/style/function/categorical_stops.cpp') diff --git a/src/mbgl/style/function/categorical_stops.cpp b/src/mbgl/style/function/categorical_stops.cpp deleted file mode 100644 index dd179f5376..0000000000 --- a/src/mbgl/style/function/categorical_stops.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include -#include - -#include - -namespace mbgl { -namespace style { - -optional categoricalValue(const Value& value) { - return value.match( - [] (bool t) { return optional(t); }, - [] (uint64_t t) { return optional(int64_t(t)); }, - [] (int64_t t) { return optional(t); }, - [] (double t) { return optional(int64_t(t)); }, - [] (const std::string& t) { return optional(t); }, - [] (const auto&) { return optional(); } - ); -} - -template -optional CategoricalStops::evaluate(const Value& value) const { - auto v = categoricalValue(value); - if (!v) { - return {}; - } - auto it = stops.find(*v); - return it == stops.end() ? optional() : it->second; -} - -template class CategoricalStops; -template class CategoricalStops; -template class CategoricalStops>; -template class CategoricalStops; -template class CategoricalStops; -template class CategoricalStops; -template class CategoricalStops; -template class CategoricalStops; - -} // namespace style -} // namespace mbgl -- cgit v1.2.1