summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/RoaringBitmap/roaring/shortiterator.go
blob: ef0acbd1ca2243e9693a257aeea89d93833c16b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package roaring

type shortIterable interface {
	hasNext() bool
	next() uint16
}

type shortIterator struct {
	slice []uint16
	loc   int
}

func (si *shortIterator) hasNext() bool {
	return si.loc < len(si.slice)
}

func (si *shortIterator) next() uint16 {
	a := si.slice[si.loc]
	si.loc++
	return a
}