Skip to content

Commit

Permalink
Remove array index check in Resize method in Dictionary2<TKey, TValue>
Browse files Browse the repository at this point in the history
  • Loading branch information
Enderlook committed Aug 6, 2022
1 parent 493a52e commit 53d6e1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Enderlook.EventManager/src/Dictionary2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ private void Resize()
{
Debug.Assert(i < entries_.Length, "Index out of range.");
ref Entry entry = ref Unsafe.Add(ref entries_Root, i);
if (entries_[i].Next >= -1)
if (entry.Next >= -1)
{
int j = (int)HashHelpers.FastMod(entry.HashCode, (uint)size, fastModMultiplier_);
Debug.Assert(j < buckets_.Length, "Index out of range.");
Expand Down

0 comments on commit 53d6e1c

Please sign in to comment.