Skip to content

Commit

Permalink
Correct three code comments in Dictionary.cs (#84128)
Browse files Browse the repository at this point in the history
Three code comments refer to the EqualityComparer<TValue>.Default, instead of the correct EqualityComparer<TKey>.Default.
  • Loading branch information
theodorzoulias committed Mar 31, 2023
1 parent a6ebab9 commit 2323fc8
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ internal ref TValue FindValue(TKey key)
Entry[]? entries = _entries;
uint collisionCount = 0;

// ValueType: Devirtualize with EqualityComparer<TValue>.Default intrinsic
// ValueType: Devirtualize with EqualityComparer<TKey>.Default intrinsic
i--; // Value in _buckets is 1-based; subtract 1 from i. We do it here so it fuses with the following conditional.
do
{
Expand Down Expand Up @@ -501,7 +501,7 @@ private bool TryInsert(TKey key, TValue value, InsertionBehavior behavior)
if (typeof(TKey).IsValueType && // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types
comparer == null)
{
// ValueType: Devirtualize with EqualityComparer<TValue>.Default intrinsic
// ValueType: Devirtualize with EqualityComparer<TKey>.Default intrinsic
while (true)
{
// Should be a while loop https://github.com/dotnet/runtime/issues/9422
Expand Down Expand Up @@ -656,7 +656,7 @@ internal static class CollectionsMarshalHelper
if (typeof(TKey).IsValueType && // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types
comparer == null)
{
// ValueType: Devirtualize with EqualityComparer<TValue>.Default intrinsic
// ValueType: Devirtualize with EqualityComparer<TKey>.Default intrinsic
while (true)
{
// Should be a while loop https://github.com/dotnet/runtime/issues/9422
Expand Down

0 comments on commit 2323fc8

Please sign in to comment.