Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.HashBucket"/> struct.
 /// </summary>
 /// <param name="firstElement">The first element.</param>
 /// <param name="additionalElements">The additional elements.</param>
 private HashBucket(KeyValuePair <TKey, TValue> firstElement, ImmutableList <KeyValuePair <TKey, TValue> > .Node additionalElements = null)
 {
     _firstValue         = firstElement;
     _additionalElements = additionalElements ?? ImmutableList <KeyValuePair <TKey, TValue> > .Node.EmptyNode;
 }
Example #2
0
        /// <summary>
        /// Returns an immutable copy of the current contents of the builder's collection.
        /// </summary>
        /// <param name="builder">The builder to create the immutable list from.</param>
        /// <returns>An immutable list.</returns>
        public static ImmutableList <TSource> ToImmutableList <TSource>(this ImmutableList <TSource> .Builder builder)
        {
            Requires.NotNull(builder, nameof(builder));

            return(builder.ToImmutable());
        }