internal virtual void DoIterate2(BitArray a, OpenBitSet b) { int aa = -1, bb = -1; OpenBitSetIterator iterator = new OpenBitSetIterator(b); do { aa = a.NextSetBit(aa + 1); bb = Random().NextBoolean() ? iterator.NextDoc() : iterator.Advance(bb + 1); Assert.AreEqual(aa == -1 ? DocIdSetIterator.NO_MORE_DOCS : aa, bb); } while (aa >= 0); }
internal virtual void DoIterate2(System.Collections.BitArray a, OpenBitSet b) { int aa = -1, bb = -1; OpenBitSetIterator iterator = new OpenBitSetIterator(b); do { aa = BitSetSupport.NextSetBit(a, aa + 1); bb = rand.NextDouble() > 0.5 ? iterator.NextDoc(null) : iterator.Advance(bb + 1, null); Assert.AreEqual(aa == -1?DocIdSetIterator.NO_MORE_DOCS:aa, bb); }while (aa >= 0); }
internal virtual void DoIterate1(System.Collections.BitArray a, OpenBitSet b) { int aa = - 1, bb = - 1; OpenBitSetIterator iterator = new OpenBitSetIterator(b); do { aa = SupportClass.BitSetSupport.NextSetBit(a, aa + 1); bb = rand.NextDouble() > 0.5 ? iterator.NextDoc() : iterator.Advance(bb + 1); Assert.AreEqual(aa == - 1?DocIdSetIterator.NO_MORE_DOCS:aa, bb); } while (aa >= 0); }