summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2020-03-27 18:30:35 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2020-04-17 03:17:22 +0300
commit9eb5456506d038d5b86cd7bc117eab0138d700d9 (patch)
tree8b5bd6e130c9e138e7fed5b8926fa34d7ec933d3
parent0bfa98bbbb38ab2afe6586f17efdb496662a17dc (diff)
downloadqtlocation-mapboxgl-9eb5456506d038d5b86cd7bc117eab0138d700d9.tar.gz
[core] Fix performance-inefficient-vector-operation errors in header files
As reported by clang-tidy-8.
-rw-r--r--include/mbgl/style/expression/value.hpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/mbgl/style/expression/value.hpp b/include/mbgl/style/expression/value.hpp
index 80e6b65233..ad11d1ceb4 100644
--- a/include/mbgl/style/expression/value.hpp
+++ b/include/mbgl/style/expression/value.hpp
@@ -142,6 +142,7 @@ optional<T> fromExpressionValue(const Value& value) {
template <typename T>
std::vector<optional<T>> fromExpressionValues(const std::vector<optional<Value>>& values) {
std::vector<optional<T>> result;
+ result.reserve(values.size());
for (const auto& value : values) {
result.push_back(value ? fromExpressionValue<T>(*value) : nullopt);
}