Cleanup: reserve vector before an append loop
Pull Request: https://projects.blender.org/blender/blender/pulls/109416
This commit is contained in:
committed by
Jacques Lucke
parent
d886fc0238
commit
4060ba4024
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user