Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ImmutableDictionary&lt;TKey, TValue&gt;"/> class.
        /// </summary>
        /// <param name="root">The root.</param>
        /// <param name="comparers">The comparers.</param>
        /// <param name="count">The number of elements in the map.</param>
        private ImmutableDictionary(ImmutableSortedDictionary <int, HashBucket> .Node root, Comparers comparers, int count)
            : this(Requires.NotNull(comparers, "comparers"))
        {
            Requires.NotNull(root, "root");

            root.Freeze(FreezeBucketAction);
            this.root  = root;
            this.count = count;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ImmutableHashSet&lt;T&gt;"/> class.
        /// </summary>
        /// <param name="root">The sorted set that this set wraps.</param>
        /// <param name="equalityComparer">The equality comparer used by this instance.</param>
        /// <param name="count">The number of elements in this collection.</param>
        private ImmutableHashSet(ImmutableSortedDictionary <int, HashBucket> .Node root, IEqualityComparer <T> equalityComparer, int count)
        {
            Requires.NotNull(root, "root");
            Requires.NotNull(equalityComparer, "equalityComparer");

            root.Freeze(FreezeBucketAction);
            this.root             = root;
            this.count            = count;
            this.equalityComparer = equalityComparer;
        }