The last element of each 2048-element section was being skipped because
the size of an `IndexRange` was being calculated like
`range.last() - range.start()`, but it should have been like
`range.one_after_last() - range.start()`. For example, the `IndexRange`
starting at `0` with a size of `3` contains the values `0`, `1` and `2`,
so `.start() == 0`, `.last() == 2` and `.one_after_last() == 3`.
False positives could occur because the entirety of the `values` array
was always being checked, even when only the first few elements were
initialized. An end iterator matching the end of the initialized
elements is now used instead of the end of the array itself.
The `value` argument was ignored by some code paths, which instead
always checked for `true`. This didn't cause any issues currently,
because all uses of #contains are searching for `true`, but this may not
be the case in the future.
Pull Request: https://projects.blender.org/blender/blender/pulls/116834