BLI: refactor IndexMask for better performance and memory usage #104629
|
@ -7,8 +7,9 @@
|
|||
namespace blender {
|
||||
|
||||
/**
|
||||
* An #OffsetSpan where a constant offset is added to every value when accessed. This allows e.g.
|
||||
* storing multiple `int64_t` indices as an array of `int16_t` with an additional `int64_t` offset.
|
||||
* An #OffsetSpan is a #Span with a constant offset that is added to every value when accessed.
|
||||
JacquesLucke marked this conversation as resolved
Outdated
|
||||
* This allows e.g. storing multiple `int64_t` indices as an array of `int16_t` with an additional
|
||||
* `int64_t` offset.
|
||||
*/
|
||||
template<typename T, typename BaseT> class OffsetSpan {
|
||||
private:
|
||||
|
|
|
@ -60,7 +60,7 @@ template<typename T> inline std::optional<IndexRange> non_empty_as_range_try(con
|
|||
}
|
||||
|
||||
/**
|
||||
* \return Amount of consecutive indices at the start of the span.
|
||||
* \return Amount of consecutive indices at the start of the span. This takes O(log #indices) time.
|
||||
*
|
||||
* Example:
|
||||
* [3, 4, 5, 6, 8, 9, 10]
|
||||
|
@ -78,7 +78,7 @@ template<typename T> inline int64_t find_size_of_next_range(const Span<T> indice
|
|||
|
||||
/**
|
||||
* \return Amount of non-consecutive indices until the next encoded range of at least
|
||||
* #min_range_size elements starts.
|
||||
* #min_range_size elements starts. This takes O(size_until_next_range) time.
|
||||
*
|
||||
* Example:
|
||||
* [1, 2, 4, 6, 7, 8, 9, 10, 13];
|
||||
|
|
Loading…
Reference in New Issue
An #OffsetSpan where a constant
->An #OffsetSpan is a #Span with a constant