BLI: Add index_range method to VectorSet
This can simplify iterating through all of the indices in the vector, which is fairly common, since one of the benefits of the data structure is that all values are contiguous.
This commit is contained in:
parent
8c1ddee10c
commit
44ca984dc7
|
@ -464,6 +464,14 @@ class VectorSet {
|
|||
return keys_ + this->size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an index range containing all valid indices for this array.
|
||||
*/
|
||||
IndexRange index_range() const
|
||||
{
|
||||
return IndexRange(this->size());
|
||||
}
|
||||
|
||||
/**
|
||||
* Print common statistics like size and collision count. This is useful for debugging purposes.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue