Refactor: Invert return value of array_utils::indexed_data_equal

This PR inverts the return values of `indexed_data_equal` to make the
function return as one would expect (i.e. if everything is equal then it
returns true, if any are not equal it returns false)

Pull Request: https://projects.blender.org/blender/blender/pulls/121056
This commit is contained in:
Sean Kim
2024-04-25 02:31:27 +02:00
committed by Hans Goudey
parent 2548132e23
commit a03bf7e055
3 changed files with 5 additions and 5 deletions

View File

@@ -300,10 +300,10 @@ bool indexed_data_equal(const Span<T> all_values, const Span<int> indices, const
{
for (const int i : indices.index_range()) {
if (all_values[indices[i]] != values[i]) {
return true;
return false;
}
}
return false;
return true;
}
bool indices_are_range(Span<int> indices, IndexRange range);

View File

@@ -216,7 +216,7 @@ static void vert_hide_update(Object &object,
new_hide.reinitialize(verts.size());
array_utils::gather(hide_vert.span.as_span(), verts, new_hide.as_mutable_span());
calc_hide(verts, new_hide);
if (!array_utils::indexed_data_equal<bool>(hide_vert.span, verts, new_hide)) {
if (array_utils::indexed_data_equal<bool>(hide_vert.span, verts, new_hide)) {
continue;
}

View File

@@ -517,7 +517,7 @@ static void face_sets_update(Object &object,
MutableSpan<int> new_face_sets = tls.new_face_sets;
array_utils::gather(face_sets.span.as_span(), faces, new_face_sets);
calc_face_sets(faces, new_face_sets);
if (!array_utils::indexed_data_equal<int>(face_sets.span, faces, new_face_sets)) {
if (array_utils::indexed_data_equal<int>(face_sets.span, faces, new_face_sets)) {
continue;
}
@@ -1021,7 +1021,7 @@ static void face_hide_update(Object &object,
MutableSpan<bool> new_hide = tls.new_hide;
array_utils::gather(hide_poly.span.as_span(), faces, new_hide);
calc_hide(faces, new_hide);
if (!array_utils::indexed_data_equal<bool>(hide_poly.span, faces, new_hide)) {
if (array_utils::indexed_data_equal<bool>(hide_poly.span, faces, new_hide)) {
continue;
}