Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/intern/index_mask.cc')
-rw-r--r--source/blender/blenlib/intern/index_mask.cc20
1 files changed, 5 insertions, 15 deletions
diff --git a/source/blender/blenlib/intern/index_mask.cc b/source/blender/blenlib/intern/index_mask.cc
index cba985b8a44..a73e6caf313 100644
--- a/source/blender/blenlib/intern/index_mask.cc
+++ b/source/blender/blenlib/intern/index_mask.cc
@@ -18,21 +18,11 @@
namespace blender {
-/**
- * Create a sub-mask that is also shifted to the beginning. The shifting to the beginning allows
- * code to work with smaller indices, which is more memory efficient.
- *
- * \return New index mask with the size of #slice. It is either empty or starts with 0. It might
- * reference indices that have been appended to #r_new_indices.
- *
- * Example:
- * this: [2, 3, 5, 7, 8, 9, 10]
- * slice: ^--------^
- * output: [0, 2, 4, 5]
- *
- * All the indices in the sub-mask are shifted by 3 towards zero, so that the first index in the
- * output is zero.
- */
+IndexMask IndexMask::slice(IndexRange slice) const
+{
+ return IndexMask(indices_.slice(slice));
+}
+
IndexMask IndexMask::slice_and_offset(const IndexRange slice, Vector<int64_t> &r_new_indices) const
{
const int slice_size = slice.size();