Esempio n. 1
0
 public HashEntry(int i, int j, object obj, HashEntry hashentry)
 {
     valueEntry = obj;
     nextEntry = hashentry;
     hashEntry = j;
     slotHash = i;
 }
Esempio n. 2
0
 private void insert(int i, int j, object obj, int k)
 {
     HashEntry hashentry = slots[k];
     slots[k] = new HashEntry(i, j, obj, hashentry);
     if (count++ >= threshold)
     {
         grow(2*slots.Length);
     }
 }
Esempio n. 3
0
 private void grow(int i)
 {
     HashEntry[] ahashentry = slots;
     int j = ahashentry.Length;
     if (j == 0x40000000)
     {
         threshold = 0x7fffffff;
         return;
     }
     else
     {
         var ahashentry1 = new HashEntry[i];
         copyTo(ahashentry1);
         slots = ahashentry1;
         threshold = (int) (i*growFactor);
         return;
     }
 }
Esempio n. 4
0
 private void copyTo(HashEntry[] ahashentry)
 {
     HashEntry[] ahashentry1 = slots;
     int i = ahashentry.Length;
     for (int j = 0; j < ahashentry1.Length; j++)
     {
         HashEntry hashentry = ahashentry1[j];
         if (hashentry == null)
         {
             continue;
         }
         ahashentry1[j] = null;
         do
         {
             HashEntry hashentry1 = hashentry.nextEntry;
             int k = getSlotIndex(hashentry.slotHash, i);
             hashentry.nextEntry = ahashentry[k];
             ahashentry[k] = hashentry;
             hashentry = hashentry1;
         } while (hashentry != null);
     }
 }