4 "github.com/elliotchance/orderedmap"
6 "github.com/anacrolix/missinggo/v2/prioritybitmap"
9 type stableSet struct {
10 om *orderedmap.OrderedMap
13 func (s stableSet) Has(bit int) bool {
14 _, ok := s.om.Get(bit)
18 func (s stableSet) Delete(bit int) {
22 func (s stableSet) Len() int {
26 func (s stableSet) Set(bit int) {
27 s.om.Set(bit, struct{}{})
30 func (s stableSet) Range(f func(int) bool) {
31 for e := s.om.Front(); e != nil; e = e.Next() {
38 func priorityBitmapStableNewSet() prioritybitmap.Set {
39 return stableSet{om: orderedmap.NewOrderedMap()}