How to implement a reverse roaring bitmap iterator? (sroar.Bitmap.NewReverseIterator went away?)

Hey :wave:

Just to increase visibility, I commented on opt(iterator): Optimise the iterator and introduce range iterators by ahsanbarkati 路 Pull Request #19 路 dgraph-io/sroar 路 GitHub but perhaps opening it out on the forum is good.

I鈥檓 doing some upgrade work and have some code which made use of NewReverseIterator() (from github.com/dgraph-io/sroar) which was removed in opt(iterator): Optimise the iterator and introduce range iterators by ahsanbarkati 路 Pull Request #19 路 dgraph-io/sroar 路 GitHub.

I am trying to learn how to write a reverse iterator with the new APIs which are NewIterator() and Next() as far as I understand. Does anyone have any tips on how to proceed?

The code in question looks more or less like this:

	if opts.Descending {
		it = resulting.NewReverseIterator()
	} else {
		it = resulting.NewIterator()
	}

	for it.HasNext() {
		v := it.Next()
                ...

Thanks!

PS. Sorry if I got the wrong category, I don鈥檛 see something that corresponds to github.com/draph-io/sroar here on the forum? :thinking:

In the meantime鈥 came up with something in chore: upgrade go deps by decentral1se 路 Pull Request #176 路 ssbc/go-ssb 路 GitHub :+1: Would still love to see a reverse iterator implementation which doesn鈥檛 have the additional allocations鈥 afaiu that functionality is lost in that above mentioned PR?