Next returns the next integer
()
| 854 | |
| 855 | // Next returns the next integer |
| 856 | func (iui *unsetIterator) Next() uint32 { |
| 857 | if iui.iter == nil { |
| 858 | // We're in an empty container gap |
| 859 | x := (uint32(iui.nextKey) << 16) | uint32(iui.emptyContainerVal) |
| 860 | iui.emptyContainerVal++ |
| 861 | if iui.emptyContainerVal == 0 || uint64(iui.nextKey)<<16|uint64(iui.emptyContainerVal) >= iui.end { |
| 862 | // Wrapped around or reached end, move to next container |
| 863 | iui.nextKey++ |
| 864 | iui.init() |
| 865 | } |
| 866 | return x |
| 867 | } |
| 868 | |
| 869 | x := uint32(iui.iter.next()) | iui.hs |
| 870 | if !iui.iter.hasNext() || uint64(iui.nextKey)<<16|uint64(iui.iter.peekNext()) >= iui.end { |
| 871 | iui.nextKey++ |
| 872 | iui.containerIndex++ |
| 873 | iui.init() |
| 874 | } |
| 875 | return x |
| 876 | } |
| 877 | |
| 878 | // PeekNext peeks the next value without advancing the iterator |
| 879 | func (iui *unsetIterator) PeekNext() uint32 { |