private void Grow()
{
HashArray temp = this.hashArrays[this.hashArrays.Length - 1];
for (int i = this.hashArrays.Length - 1; i > 0; i--)
{
this.hashArrays[i] = this.hashArrays[i - 1];
}
this.capacity *= 2;
this.hashArrays[0] = new HashArray(this.capacity);
for (int i = 1; i < this.hashArrays.Length; i++)
{
int[] sourceOffsetArray = this.hashArrays[i].offsets;
int[] sourceCidsArray = this.hashArrays[i].cids;
for (int k = 0; k < sourceOffsetArray.Length; k++)
{
for (int j = 0; j < i && sourceOffsetArray[k] != 0; j++)
{
int[] targetOffsetArray = this.hashArrays[j].offsets;
int[] targetCidsArray = this.hashArrays[j].cids;
int newIndex = IndexFor(StringHashCode(this.labelRepository, sourceOffsetArray[k]), targetOffsetArray.Length);
if (targetOffsetArray[newIndex] == 0)
{
targetOffsetArray[newIndex] = sourceOffsetArray[k];
targetCidsArray[newIndex] = sourceCidsArray[k];
sourceOffsetArray[k] = 0;
}
}
}
}
for (int i = 0; i < temp.offsets.Length; i++)
{
int offset = temp.offsets[i];
if (offset > 0)
{
int hash = StringHashCode(this.labelRepository, offset);
AddLabelOffset(hash, temp.cids[i], offset);
}
}
CollisionMap oldCollisionMap = this.collisionMap;
this.collisionMap = new CollisionMap(oldCollisionMap.Capacity, this.labelRepository);
this.threshold = (int)(this.capacity * this.loadFactor);
var it = oldCollisionMap.GetEnumerator();
while (it.MoveNext())
{
var e = it.Current;
AddLabelOffset(StringHashCode(this.labelRepository, e.offset), e.cid, e.offset);
}
}