[core] Fix performance-inefficient-vector-operation errors in header files

As reported by clang-tidy-8.
This commit is contained in:
Thiago Marcos P. Santos
2020-03-27 18:30:35 +02:00
parent c4cb026fa4
commit c21cf413b8

View File

@@ -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);
}