diff options
Diffstat (limited to 'src/mbgl/style/expression/is_constant.cpp')
-rw-r--r-- | src/mbgl/style/expression/is_constant.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mbgl/style/expression/is_constant.cpp b/src/mbgl/style/expression/is_constant.cpp index b877ed550a..3b1f1aba8c 100644 --- a/src/mbgl/style/expression/is_constant.cpp +++ b/src/mbgl/style/expression/is_constant.cpp @@ -9,7 +9,8 @@ namespace expression { constexpr static const char filter[] = "filter-"; bool isFeatureConstant(const Expression& expression) { - if (auto e = dynamic_cast<const CompoundExpressionBase*>(&expression)) { + if (expression.getKind() == Kind::CompoundExpression) { + auto e = static_cast<const CompoundExpressionBase*>(&expression); const std::string name = e->getName(); optional<std::size_t> parameterCount = e->getParameterCount(); if (name == "get" && parameterCount && *parameterCount == 1) { @@ -28,7 +29,7 @@ bool isFeatureConstant(const Expression& expression) { } } - if (dynamic_cast<const CollatorExpression*>(&expression)) { + if (expression.getKind() == Kind::CollatorExpression) { // Although the results of a Collator expression with fixed arguments // generally shouldn't change between executions, we can't serialize them // as constant expressions because results change based on environment. |