Lucene.Net.Util.OpenBitSet.Intersect C# (CSharp) Method

Intersect() public method

this = this AND other
public Intersect ( OpenBitSet other ) : void
other OpenBitSet
return void
		public virtual void  Intersect(OpenBitSet other)
		{
			int newLen = System.Math.Min(this.wlen, other.wlen);
			long[] thisArr = this.internalbits;
			long[] otherArr = other.internalbits;
			// testing against zero can be more efficient
			int pos = newLen;
			while (--pos >= 0)
			{
				thisArr[pos] &= otherArr[pos];
			}
			if (this.wlen > newLen)
			{
				// fill zeros from the new shorter length to the old length
                for (int i = newLen; i < this.wlen; i++)
                    internalbits[i] = 0L;
			}
			this.wlen = newLen;
		}