private void ChangeOver()
{
IDictionaryEnumerator en = list.GetEnumerator();
Hashtable newTable;
if (caseInsensitive)
{
newTable = new Hashtable(InitialHashtableSize, StringComparer.OrdinalIgnoreCase);
}
else
{
newTable = new Hashtable(InitialHashtableSize);
}
while (en.MoveNext())
{
newTable.Add(en.Key, en.Value);
}
// <STRIP>
// Keep the order of writing to hashtable and list.
// We assume we will see the change in hashtable if list is set to null in
// this method in another reader thread.
// </STRIP>
hashtable = newTable;
list = null;
}