summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Wojciechowski <lucas@mapbox.com>2018-02-21 14:14:08 -0800
committerLucas Wojciechowski <lucas@mapbox.com>2018-03-07 11:46:17 -0800
commitf4eb02aebc94fb16b9e87c711e7c62b077e294e7 (patch)
treebeab6ece6bfc913e04860c5d5343bae22c6f0d1d
parentbce45e89a777642a9a9e98f2be9bb6342083450f (diff)
downloadqtlocation-mapboxgl-f4eb02aebc94fb16b9e87c711e7c62b077e294e7.tar.gz
Switch back to a shared_ptr per chat with @anandthakker
-rw-r--r--include/mbgl/style/filter.hpp4
-rw-r--r--src/mbgl/style/conversion/stringify.hpp2
-rw-r--r--src/mbgl/style/filter_evaluator.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/include/mbgl/style/filter.hpp b/include/mbgl/style/filter.hpp
index 99a5426c2b..040f7808a7 100644
--- a/include/mbgl/style/filter.hpp
+++ b/include/mbgl/style/filter.hpp
@@ -236,10 +236,10 @@ public:
class ExpressionFilter {
public:
- expression::Expression &expression;
+ std::shared_ptr<expression::Expression> expression;
friend bool operator==(const ExpressionFilter& lhs, const ExpressionFilter& rhs) {
- return lhs.expression == rhs.expression;
+ return *(lhs.expression) == *(rhs.expression);
}
};
diff --git a/src/mbgl/style/conversion/stringify.hpp b/src/mbgl/style/conversion/stringify.hpp
index 0d1d4d85fb..7924a442c4 100644
--- a/src/mbgl/style/conversion/stringify.hpp
+++ b/src/mbgl/style/conversion/stringify.hpp
@@ -227,7 +227,7 @@ public:
}
void operator()(const ExpressionFilter& filter) {
- stringify(writer, filter.expression.serialize());
+ stringify(writer, filter.expression->serialize());
}
private:
diff --git a/src/mbgl/style/filter_evaluator.cpp b/src/mbgl/style/filter_evaluator.cpp
index 39f356a8b1..72022172f4 100644
--- a/src/mbgl/style/filter_evaluator.cpp
+++ b/src/mbgl/style/filter_evaluator.cpp
@@ -213,7 +213,7 @@ bool FilterEvaluator::operator()(const NotHasIdentifierFilter&) const {
}
bool FilterEvaluator::operator()(const ExpressionFilter& filter) const {
- const expression::EvaluationResult result = filter.expression.evaluate(context);
+ const expression::EvaluationResult result = filter.expression->evaluate(context);
if (result) {
const optional<bool> typed = expression::fromExpressionValue<bool>(*result);
return typed ? *typed : false;