Fix: False positives/negatives in curves_selection.cc#contains #116834

Merged
Hans Goudey merged 5 commits from Mysteryem/blender:fix_curves_selection_contains into main 2024-01-09 17:40:23 +01:00
1 changed files with 2 additions and 1 deletions
Showing only changes of commit 2108a6b619 - Show all commits

View File

@ -191,7 +191,8 @@ static bool contains(const VArray<bool> &varray,
return init;
}
constexpr int64_t MaxChunkSize = 512;
Review

How about using a variable to simplify this a bit:

const int64_t slice_end = range.one_after_last();
How about using a variable to simplify this a bit: ```cpp const int64_t slice_end = range.one_after_last(); ```
for (int64_t start = range.start(); start < range.one_after_last(); start += MaxChunkSize) {
for (int64_t start = range.start(); start < range.one_after_last(); start += MaxChunkSize)
{
const int64_t end = std::min<int64_t>(start + MaxChunkSize, range.one_after_last());
const int64_t size = end - start;
const IndexMask sliced_mask = indices_to_check.slice(start, size);