diff options
Diffstat (limited to 'src/mbgl/style/expression')
-rw-r--r-- | src/mbgl/style/expression/compound_expression.cpp | 3 | ||||
-rw-r--r-- | src/mbgl/style/expression/expression.cpp | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/mbgl/style/expression/compound_expression.cpp b/src/mbgl/style/expression/compound_expression.cpp index cc1d58025b..34f0f5dea3 100644 --- a/src/mbgl/style/expression/compound_expression.cpp +++ b/src/mbgl/style/expression/compound_expression.cpp @@ -423,7 +423,8 @@ const auto& propertiesCompoundExpression() { }; } std::unordered_map<std::string, Value> result; - const PropertyMap properties = params.feature->getProperties(); + const PropertyMap& properties = params.feature->getProperties(); + result.reserve(properties.size()); for (const auto& entry : properties) { result[entry.first] = toExpressionValue(entry.second); } diff --git a/src/mbgl/style/expression/expression.cpp b/src/mbgl/style/expression/expression.cpp index 4c810431d0..d61f435eec 100644 --- a/src/mbgl/style/expression/expression.cpp +++ b/src/mbgl/style/expression/expression.cpp @@ -15,7 +15,7 @@ public: FeatureType getType() const override { return apply_visitor(ToFeatureType(), feature.geometry); } - PropertyMap getProperties() const override { return feature.properties; } + const PropertyMap& getProperties() const override { return feature.properties; } FeatureIdentifier getID() const override { return feature.id; } optional<mbgl::Value> getValue(const std::string& key) const override { auto it = feature.properties.find(key); |