Пример #1
0
 /// <summary>
 /// Performs the set operation on a given data structure.
 /// </summary>
 private static SortedInt32KeyNode <HashBucket> UpdateRoot(SortedInt32KeyNode <HashBucket> root, int hashCode, IEqualityComparer <HashBucket> hashBucketEqualityComparer, HashBucket newBucket)
 {
     if (newBucket.IsEmpty)
     {
         return(root.Remove(hashCode, out _));
     }
     else
     {
         return(root.SetItem(hashCode, newBucket, hashBucketEqualityComparer, out _, out _));
     }
 }
Пример #2
0
        /// <summary>
        /// Performs the set operation on a given data structure.
        /// </summary>
        private static SortedInt32KeyNode <HashBucket> UpdateRoot(SortedInt32KeyNode <HashBucket> root, int hashCode, IEqualityComparer <HashBucket> hashBucketEqualityComparer, HashBucket newBucket)
        {
            bool mutated;

            if (newBucket.IsEmpty)
            {
                return(root.Remove(hashCode, out mutated));
            }
            else
            {
                return(root.SetItem(hashCode, newBucket, hashBucketEqualityComparer, out bool replacedExistingValue, out mutated));
            }
        }