private int GetHeaderIndex(int attributeValue)
{
if (attributeValue >= headerTableLookup.Length)
{
ResizeHeaderLookup(attributeValue);
}
int index = headerTableLookup[attributeValue];
if (index == -1)
{ // if attribute didnt exist;
if (headerTableCount >= headerTableAttributes.Length)
{
ResizeHeaderTable();
}
headerTableAttributes[headerTableCount] = attributeValue;
if (headerTableProperties[headerTableCount] == null)
{
headerTableProperties[headerTableCount] = new int[HEADERTABLEBLOCKSIZE];
}
headerTableAttributeCount[headerTableCount] = 0;
headerTableProperties[headerTableCount][HT_NEXT] = -1;
headerTableProperties[headerTableCount][HT_LAST] = -1;
index = headerTableCount++;
headerTableLookup[attributeValue] = index;
sortedSet.Add(attributeValue);
}
return index;
}