aboutsummaryrefslogtreecommitdiff
path: root/src/trace_processor/containers/bit_vector_iterators.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/trace_processor/containers/bit_vector_iterators.h')
-rw-r--r--src/trace_processor/containers/bit_vector_iterators.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/trace_processor/containers/bit_vector_iterators.h b/src/trace_processor/containers/bit_vector_iterators.h
index 004781213..62094ffa3 100644
--- a/src/trace_processor/containers/bit_vector_iterators.h
+++ b/src/trace_processor/containers/bit_vector_iterators.h
@@ -132,6 +132,16 @@ class AllBitsIterator : public BaseIterator {
// Increments the iterator to point to the next bit.
void Next() { SetIndex(index() + 1); }
+ // Increments the iterator to skip the next |n| bits and point to the
+ // following one.
+ // Precondition: n >= 1 & index() + n <= size().
+ void Skip(uint32_t n) {
+ PERFETTO_DCHECK(n >= 1);
+ PERFETTO_DCHECK(index() + n <= size());
+
+ SetIndex(index() + n);
+ }
+
// Returns whether the iterator is valid.
operator bool() const { return index() < size(); }
};