// 64 bit shifts private void Shift() { if ((int)word == 0) { wordShift += 32; word = (long)((ulong)word >> 32); } if ((word & 0x0000FFFF) == 0) { wordShift += 16; word = (long)((ulong)word >> 16); } if ((word & 0x000000FF) == 0) { wordShift += 8; word = (long)((ulong)word >> 8); } indexArray = BitUtil.BitList((byte)word); }
public override int NextDoc() { if (bitList != 0) // there are remaining bits in the current word { docID = (wordNum << 3) | ((bitList & 0x0F) - 1); bitList = (int)((uint)bitList >> 4); return(docID); } NextWord(); if (wordNum == int.MaxValue) { return(docID = NO_MORE_DOCS); } bitList = BitUtil.BitList(word); Debug.Assert(bitList != 0); docID = (wordNum << 3) | ((bitList & 0x0F) - 1); bitList = (int)((uint)bitList >> 4); return(docID); }
public override int NextDoc() { if (bitList != 0) // there are remaining bits in the current word { docID = (wordNum << 3) | ((bitList & 0x0F) - 1); bitList = bitList.TripleShift(4); return(docID); } NextWord(); if (wordNum == int.MaxValue) { return(docID = NO_MORE_DOCS); } bitList = BitUtil.BitList(word); if (Debugging.AssertsEnabled) { Debugging.Assert(bitList != 0); } docID = (wordNum << 3) | ((bitList & 0x0F) - 1); bitList = bitList.TripleShift(4); return(docID); }