コード例 #1
0
ファイル: ArrayIntroSorter.cs プロジェクト: wow64bb/YAFNET
 protected override void Swap(int i, int j)
 {
     ArrayUtil.Swap(arr, i, j);
 }
コード例 #2
0
 /// <summary>
 /// Used to grow the reference array.
 /// <para/>
 /// In general this should not be used as it does not take the offset into account.
 /// <para/>
 /// @lucene.internal
 /// </summary>
 public void Grow(int newLength)
 {
     Debug.Assert(Offset == 0); // NOTE: senseless if offset != 0
     bytes = ArrayUtil.Grow(bytes, newLength);
 }
コード例 #3
0
 /// <summary>
 /// Expand the <see cref="T:long[]"/> with the size given as a number of words (64 bit longs). </summary>
 public virtual void EnsureCapacityWords(int numWords)
 {
     m_bits = ArrayUtil.Grow(m_bits, numWords);
     m_wlen = numWords;
     Debug.Assert((this.numBits = Math.Max(this.numBits, numWords << 6)) >= 0);
 }
コード例 #4
0
ファイル: BytesRefHash.cs プロジェクト: YAFNET/YAFNET
 public override int[] Init()
 {
     return(bytesStart = new int[ArrayUtil.Oversize(m_initSize, RamUsageEstimator.NUM_BYTES_INT32)]);
 }
コード例 #5
0
 /// <summary>
 /// Create a <see cref="GrowableByteArrayDataOutput"/> with the given initial capacity. </summary>
 public GrowableByteArrayDataOutput(int cp)
 {
     this.bytes  = new byte[ArrayUtil.Oversize(cp, 1)];
     this.Length = 0;
 }