BLI: Add assert for indexed_data_equal
Typically, we use this function to determine whether or not a subset of data that has been collected with `gather` needs to be then persisted into a larger array with `scatter`. As such, it makes sense to assert on equality of the indices and smaller array size. Pull Request: https://projects.blender.org/blender/blender/pulls/140752
This commit is contained in:
@@ -326,6 +326,7 @@ template<typename T> inline void fill_index_range(MutableSpan<T> span, const T s
|
||||
template<typename T>
|
||||
bool indexed_data_equal(const Span<T> all_values, const Span<int> indices, const Span<T> values)
|
||||
{
|
||||
BLI_assert(indices.size() == values.size());
|
||||
for (const int i : indices.index_range()) {
|
||||
if (all_values[indices[i]] != values[i]) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user