summaryrefslogtreecommitdiff
path: root/include/mbgl/style/expression/at.hpp
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2018-07-20 15:40:47 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2018-07-24 10:06:18 +0300
commitcb714d57c5c5ad181aaf5e1690221da8d965682b (patch)
tree21fa8cc6caf1e66de40f9715fa98426e86cfd964 /include/mbgl/style/expression/at.hpp
parent1683da3225d0cbed3bb6238fd292fa288f6a32d6 (diff)
downloadqtlocation-mapboxgl-cb714d57c5c5ad181aaf5e1690221da8d965682b.tar.gz
[core] Replace expressions RTTI with enums + static cast
Diffstat (limited to 'include/mbgl/style/expression/at.hpp')
-rw-r--r--include/mbgl/style/expression/at.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/mbgl/style/expression/at.hpp b/include/mbgl/style/expression/at.hpp
index 1e6f1c7dd2..f0dbccb794 100644
--- a/include/mbgl/style/expression/at.hpp
+++ b/include/mbgl/style/expression/at.hpp
@@ -11,7 +11,7 @@ namespace expression {
class At : public Expression {
public:
At(std::unique_ptr<Expression> index_, std::unique_ptr<Expression> input_) :
- Expression(input_->getType().get<type::Array>().itemType),
+ Expression(Kind::At, input_->getType().get<type::Array>().itemType),
index(std::move(index_)),
input(std::move(input_))
{}
@@ -22,7 +22,8 @@ public:
void eachChild(const std::function<void(const Expression&)>&) const override;
bool operator==(const Expression& e) const override {
- if (auto rhs = dynamic_cast<const At*>(&e)) {
+ if (e.getKind() == Kind::At) {
+ auto rhs = static_cast<const At*>(&e);
return *index == *(rhs->index) && *input == *(rhs->input);
}
return false;