示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}"/> 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(SortedInt32KeyNode <HashBucket> root, Comparers comparers, int count)
            : this(Requires.NotNullPassthrough(comparers, nameof(comparers)))
        {
            Requires.NotNull(root, nameof(root));

            root.Freeze(s_FreezeBucketAction);
            _root  = root;
            _count = count;
        }
示例#2
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.NotNullPassthrough(comparers, "comparers"))
        {
            Requires.NotNull(root, "root");

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