diff options
author | Lucas Wojciechowski <lucas@mapbox.com> | 2018-04-10 18:26:05 -0700 |
---|---|---|
committer | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2018-05-09 16:06:10 -0700 |
commit | 4f4e7930d5eaf96de028e5be1f36f8c7bc9b2cb1 (patch) | |
tree | 0caae2ae6e33a2a20687d79e9f53b561447eb8bb | |
parent | aca5a8ff696030924a0b35bd415433a9b3bb3f3e (diff) | |
download | qtlocation-mapboxgl-4f4e7930d5eaf96de028e5be1f36f8c7bc9b2cb1.tar.gz |
Eliminate "stringAsFeatureType"
-rw-r--r-- | src/mbgl/style/expression/compound_expression.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/mbgl/style/expression/compound_expression.cpp b/src/mbgl/style/expression/compound_expression.cpp index cb7cd8ebbf..2937aed820 100644 --- a/src/mbgl/style/expression/compound_expression.cpp +++ b/src/mbgl/style/expression/compound_expression.cpp @@ -230,14 +230,6 @@ Value featurePropertyAsExpressionValue(EvaluationContext params, const std::stri return property ? toExpressionValue(*property) : Null; }; -optional<FeatureType> stringAsFeatureType(const std::string &type) { - if (type == "Point") return FeatureType::Point; - else if (type == "LineString") return FeatureType::LineString; - else if (type == "Polygon") return FeatureType::Polygon; - else if (type == "Unknown") return FeatureType::Unknown; - else return optional<FeatureType>(); -}; - optional<std::string> featureTypeAsString(FeatureType type) { if (type == FeatureType::Point) return optional<std::string>("Point"); else if (type == FeatureType::LineString) return optional<std::string>("LineString"); @@ -496,7 +488,7 @@ std::unordered_map<std::string, CompoundExpressionRegistry::Definition> initiali define("filter-type-==", [](const EvaluationContext& params, const std::string &lhs) -> Result<bool> { if (!params.feature) return false; - return params.feature->getType() == stringAsFeatureType(lhs); + return featureTypeAsString(params.feature->getType()) == lhs; }); define("filter-<", [](const EvaluationContext& params, const std::string& key, double lhs) -> Result<bool> { |