Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub committed Aug 15, 2023
1 parent 275be61 commit 70c9f16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ public static FrozenDictionary<TKey, TElement> ToFrozenDictionary<TSource, TKey,
private static FrozenDictionary<TKey, TValue> CreateFromDictionary<TKey, TValue>(Dictionary<TKey, TValue> source)
where TKey : notnull
{
Debug.Assert(source.Count > 0, "Empty sources should have been filtered out by caller");

IEqualityComparer<TKey> comparer = source.Comparer;

// Optimize for value types when the default comparer is being used. In such a case, the implementation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public static FrozenSet<T> ToFrozenSet<T>(this IEnumerable<T> source, IEqualityC

private static FrozenSet<T> CreateFromSet<T>(HashSet<T> source)
{
Debug.Assert(source.Count > 0, "Empty sources should have been filtered out by caller");

IEqualityComparer<T> comparer = source.Comparer;

// Optimize for value types when the default comparer is being used. In such a case, the implementation
Expand Down

0 comments on commit 70c9f16

Please sign in to comment.