@@ -27,7 +27,7 @@ internal class SmallCapacityDictionary<TKey, TValue> : IDictionary<TKey, TValue>
27
27
/// The new instance will take ownership of the array, and may mutate it.
28
28
/// </summary>
29
29
/// <param name="items">The items array.</param>
30
- /// <param name="comparer"></param>
30
+ /// <param name="comparer">Equality comparison. </param>
31
31
/// <returns>A new <see cref="SmallCapacityDictionary{TKey, TValue}"/>.</returns>
32
32
public static SmallCapacityDictionary < TKey , TValue > FromArray ( KeyValuePair < TKey , TValue > [ ] items , IEqualityComparer < TKey > ? comparer = null )
33
33
{
@@ -102,22 +102,29 @@ public SmallCapacityDictionary()
102
102
{
103
103
}
104
104
105
- public SmallCapacityDictionary ( Dictionary < TKey , TValue > dict )
106
- : this ( 0 , EqualityComparer < TKey > . Default )
107
- {
108
- _backup = dict ;
109
- }
110
-
105
+ /// <summary>
106
+ /// Creates a <see cref="SmallCapacityDictionary{TKey, TValue}"/>.
107
+ /// </summary>
108
+ /// <param name="comparer">Equality comparison.</param>
111
109
public SmallCapacityDictionary ( IEqualityComparer < TKey > comparer )
112
110
: this ( 0 , comparer )
113
111
{
114
112
}
115
113
114
+ /// <summary>
115
+ /// Creates a <see cref="SmallCapacityDictionary{TKey, TValue}"/>.
116
+ /// </summary>
117
+ /// <param name="capacity">Initial capacity.</param>
116
118
public SmallCapacityDictionary ( int capacity )
117
119
: this ( capacity , EqualityComparer < TKey > . Default )
118
120
{
119
121
}
120
122
123
+ /// <summary>
124
+ /// Creates a <see cref="SmallCapacityDictionary{TKey, TValue}"/>.
125
+ /// </summary>
126
+ /// <param name="capacity">Initial capacity.</param>
127
+ /// <param name="comparer">Equality comparison.</param>
121
128
public SmallCapacityDictionary ( int capacity , IEqualityComparer < TKey > comparer )
122
129
{
123
130
if ( comparer is not null && comparer != EqualityComparer < TKey > . Default ) // first check for null to avoid forcing default comparer instantiation unnecessarily
@@ -151,13 +158,9 @@ public SmallCapacityDictionary(int capacity, IEqualityComparer<TKey> comparer)
151
158
/// <see cref="IDictionary{TKey, TValue}"/> or <see cref="IReadOnlyDictionary{TKey, TValue}"/>
152
159
/// or an object with public properties as key-value pairs.
153
160
/// </param>
154
- /// <remarks>
155
- /// If the value is a dictionary or other <see cref="IEnumerable{T}"/> of <see cref="KeyValuePair{String, Object}"/>,
156
- /// then its entries are copied. Otherwise the object is interpreted as a set of key-value pairs where the
157
- /// property names are keys, and property values are the values, and copied into the dictionary.
158
- /// Only public instance non-index properties are considered.
159
- /// </remarks>
160
- public SmallCapacityDictionary ( IEnumerable < KeyValuePair < TKey , TValue > > values , IEqualityComparer < TKey > comparer , int capacity )
161
+ /// <param name="comparer">Equality comparison.</param>
162
+ /// <param name="capacity">Initial capacity.</param>
163
+ public SmallCapacityDictionary ( IEnumerable < KeyValuePair < TKey , TValue > > values , int capacity , IEqualityComparer < TKey > comparer )
161
164
{
162
165
_comparer = comparer ?? EqualityComparer < TKey > . Default ;
163
166
0 commit comments