예제 #1
0
 private bool ConfirmSlot(int hashCode)
 {
     GenerateIndexes(hashCode);
     if (Shortcuts.GetBit(bucketAllocation[bigIndex], smallIndex))
     {
         if (bucketHashes [leIndex] == hashCode)
         {
             return(true);
         }
     }
     return(false);
 }
예제 #2
0
 private bool _Add(int hashCode, TValue item)
 {
     if (ForceStop)
     {
         return(false);
     }
     GenerateIndexes(hashCode);
     if (Shortcuts.GetBit(bucketAllocation[bigIndex], smallIndex))
     {
         if (bucketHashes [leIndex] == hashCode)
         {
             return(false);
         }
         //Resolve collision
         return(_Add(hashCode * CollisionResolver, item));
     }
     Shortcuts.SetBitTrue(ref bucketAllocation [bigIndex], smallIndex);
     bucketValues [leIndex] = item;
     bucketHashes [leIndex] = hashCode;
     return(true);
 }