Backward returns an iterator that yields the elements of the bitmap in decreasing order. Starting with Go 1.23, users can use a for loop to iterate over it.
(b *Bitmap)
| 20 | // decreasing order. Starting with Go 1.23, users can use a for loop to iterate |
| 21 | // over it. |
| 22 | func Backward(b *Bitmap) iter.Seq[uint32] { |
| 23 | return func(yield func(uint32) bool) { |
| 24 | it := b.ReverseIterator() |
| 25 | for it.HasNext() { |
| 26 | if !yield(it.Next()) { |
| 27 | return |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | // Unset creates an iterator that yields values in the range [min, max] that are NOT contained in the bitmap. |
| 34 | // The iterator becomes invalid if the bitmap is modified (e.g., with Add or Remove). |
searching dependent graphs…