Cleanup: reserve vector before an append loop

Pull Request: https://projects.blender.org/blender/blender/pulls/109416
This commit is contained in:
Iliya Katueshenock
2023-06-28 08:48:00 +02:00
committed by Jacques Lucke
parent d886fc0238
commit 4060ba4024

View File

@@ -782,7 +782,8 @@ class VariableState : NonCopyable, NonMovable {
BLI_assert(value_typed->is_initialized);
const bool condition = *static_cast<const bool *>(value_typed->data);
Vector<int64_t> &indices = r_indices[condition];
mask.foreach_index([&](const int64_t i) { indices.append(i); });
indices.reserve(indices.size() + mask.size());
mask.foreach_index_optimized<int64_t>([&](const int64_t i) { indices.append(i); });
break;
}
case ValueType::GVVectorArray: