Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub committed Feb 7, 2023
1 parent 5fc1900 commit 21728ed
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
else
{
Debug.Assert(comparer is not null);
int hashcode = _comparerIsDefaultForClasses ? key.GetHashCode() : comparer.GetHashCode(key);
int hashcode = GetHashCode(comparer, key);
for (Node? n = GetBucket(tables, hashcode); n is not null; n = n._next)
{
if (hashcode == n._hashcode && comparer.Equals(n._key, key))
Expand Down Expand Up @@ -1303,10 +1303,9 @@ public TValue AddOrUpdate<TArg>(
}
}

Tables newTables = _tables;
if (tables != newTables)
if (tables != _tables)
{
tables = newTables;
tables = _tables;
if (!ReferenceEquals(comparer, tables._comparer))
{
comparer = tables._comparer;
Expand Down Expand Up @@ -1377,10 +1376,9 @@ public TValue AddOrUpdate(TKey key, Func<TKey, TValue> addValueFactory, Func<TKe
}
}

Tables newTables = _tables;
if (tables != newTables)
if (tables != _tables)
{
tables = newTables;
tables = _tables;
if (!ReferenceEquals(comparer, tables._comparer))
{
comparer = tables._comparer;
Expand Down Expand Up @@ -1444,10 +1442,9 @@ public TValue AddOrUpdate(TKey key, TValue addValue, Func<TKey, TValue, TValue>
}
}

Tables newTables = _tables;
if (tables != newTables)
if (tables != _tables)
{
tables = newTables;
tables = _tables;
if (!ReferenceEquals(comparer, tables._comparer))
{
comparer = tables._comparer;
Expand Down

0 comments on commit 21728ed

Please sign in to comment.